Build IDEA plugin via Maven

This commit is contained in:
Alexey Andreev 2017-02-17 23:16:16 +03:00
parent 4a5a502b62
commit b4e88988f6
44 changed files with 954 additions and 106 deletions

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="teavm-idea" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<predefined_log_file id="idea.log" enabled="true" />
<method />
</configuration>
</component>

View File

@ -1,26 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="JPS repack" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="package" />
</list>
</option>
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/tools/idea/jps-common" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method />
</configuration>
</component>

View File

@ -71,6 +71,7 @@
<slf4j.version>1.7.7</slf4j.version>
<selenium.version>2.47.2</selenium.version>
<jackson.version>2.6.2</jackson.version>
<idea.version>2016.3.4</idea.version>
<teavm.test.incremental>false</teavm.test.incremental>
<teavm.test.threads>1</teavm.test.threads>
@ -296,6 +297,7 @@
</activation>
<modules>
<module>samples</module>
<module>tools/idea</module>
</modules>
</profile>
<profile>

1
tools/idea/idea-artifacts/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/dependencies

View File

@ -0,0 +1,264 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.teavm</groupId>
<artifactId>teavm-idea-dependencies</artifactId>
<version>1.0.0-SNAPSHOT</version>
<repositories>
<repository>
<id>idea-releases</id>
<url>https://www.jetbrains.com/intellij-repository/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.jetbrains.intellij.idea</groupId>
<artifactId>ideaIC</artifactId>
<version>${idea.version}</version>
<type>zip</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-tooling</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-chrome-rdp</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-metaprogramming-impl</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>unpack-idea</id>
<phase>compile</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.jetbrains.intellij.idea</includeGroupIds>
<includeArtifactIds>ideaIC</includeArtifactIds>
<outputDirectory>${basedir}/dependencies/idea</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<atrifactSet>
<excludes>
<exclude>com.jetbrains.intellij.idea:ideaIC:zip:*</exclude>
</excludes>
</atrifactSet>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
</relocations>
<createDependencyReducedPom>false</createDependencyReducedPom>
<outputFile>dependencies/teavm.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>teavm</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>install</phase>
<configuration>
<file>dependencies/teavm.jar</file>
<artifactId>teavm</artifactId>
<version>${teavm.version}</version>
</configuration>
</execution>
<execution>
<id>openapi</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/openapi.jar</file>
<artifactId>openapi</artifactId>
</configuration>
</execution>
<execution>
<id>util</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/util.jar</file>
<artifactId>util</artifactId>
</configuration>
</execution>
<execution>
<id>extensions</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/extensions.jar</file>
<artifactId>extensions</artifactId>
</configuration>
</execution>
<execution>
<id>annotations</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/annotations.jar</file>
<artifactId>annotations</artifactId>
</configuration>
</execution>
<execution>
<id>jdom</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/jdom.jar</file>
<artifactId>jdom</artifactId>
</configuration>
</execution>
<execution>
<id>maven</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/plugins/maven/lib/maven.jar</file>
<artifactId>maven</artifactId>
</configuration>
</execution>
<execution>
<id>maven-server-api</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/plugins/maven/lib/maven-server-api.jar</file>
<artifactId>maven-server-api</artifactId>
</configuration>
</execution>
<execution>
<id>idea</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/idea.jar</file>
<artifactId>idea</artifactId>
</configuration>
</execution>
<execution>
<id>jps-model</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/jps-model.jar</file>
<artifactId>jps-model</artifactId>
</configuration>
</execution>
<execution>
<id>jps-builders</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<file>dependencies/idea/lib/jps-builders.jar</file>
<artifactId>jps-builders</artifactId>
</configuration>
</execution>
</executions>
<configuration>
<localRepositoryPath>dependencies/maven</localRepositoryPath>
<groupId>org.teavm.idea</groupId>
<version>${idea.version}</version>
<packaging>jar</packaging>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.teavm</groupId>
<artifactId>teavm-idea-parent</artifactId>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teavm-idea-artifacts</artifactId>
<name>TeaVM IDEA artifacts</name>
<packaging>pom</packaging>
<profiles>
<profile>
<id>download-dependencies</id>
<activation>
<file>
<missing>dependencies/teavm.jar</missing>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>initialize</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<arguments>
<item>-f</item>
<item>dep-pom.xml</item>
<item>install</item>
<item>-Didea.version=${idea.version}</item>
<item>-Dteavm.version=${project.version}</item>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 Alexey Andreev.
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@ -13,47 +15,66 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>teavm-idea-parent</artifactId>
<groupId>org.teavm</groupId>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.teavm</groupId>
<artifactId>teavm</artifactId>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../../..</relativePath>
</parent>
<packaging>pom</packaging>
<artifactId>teavm-jps-common</artifactId>
<name>TeaVM IDEA JPS common artifact</name>
<artifactId>teavm-jps-repack</artifactId>
<properties>
<idea.artifacts.dir>${basedir}/..</idea.artifacts.dir>
</properties>
<dependencies>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-tooling</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
<groupId>org.teavm.idea</groupId>
<artifactId>openapi</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-chrome-rdp</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
<groupId>org.teavm.idea</groupId>
<artifactId>annotations</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-metaprogramming-impl</artifactId>
<groupId>org.teavm.idea</groupId>
<artifactId>jdom</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>util</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>jps-model</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>jps-builders</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>teavm</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
@ -62,30 +83,13 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<outputFile>lib/teavm-all.jar</outputFile>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
</relocations>
<configLocation>../../checkstyle.xml</configLocation>
<propertyExpansion>config_loc=${basedir}/../../../</propertyExpansion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,26 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/teavm-all.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$MODULE_DIR$/../../core/src/main/java" />
<root url="file://$MODULE_DIR$/../../../core/src/main/java" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:openapi:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:annotations:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jdom:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:util:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-model:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-builders:2016.3.4" level="project" />
<orderEntry type="library" name="Maven: org.teavm.idea:teavm:0.5.0-SNAPSHOT" level="project" />
</component>
<component name="teavm">
<option name="mainClass" value="" />

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>teavm-idea-parent</artifactId>
<groupId>org.teavm</groupId>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teavm-jps-plugin</artifactId>
<name>TeaVM IDEA JPS plugin</name>
<properties>
<idea.artifacts.dir>${basedir}/..</idea.artifacts.dir>
</properties>
<dependencies>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>openapi</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>annotations</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>util</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>jdom</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>jps-model</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>jps-builders</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-jps-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>../../checkstyle.xml</configLocation>
<propertyExpansion>config_loc=${basedir}/../../../</propertyExpansion>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
@ -11,6 +10,13 @@
</content>
<orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="teavm-jps-common" exported="" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:openapi:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:annotations:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:util:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jdom:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-model:2016.3.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-builders:2016.3.4" level="project" />
<orderEntry type="module" module-name="teavm-jps-common" />
<orderEntry type="library" name="Maven: org.teavm.idea:teavm:0.5.0-SNAPSHOT" level="project" />
</component>
</module>

144
tools/idea/plugin/pom.xml Normal file
View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>teavm-idea-parent</artifactId>
<groupId>org.teavm</groupId>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teavm-idea</artifactId>
<name>TeaVM IDEA plugin</name>
<properties>
<idea.artifacts.dir>${basedir}/..</idea.artifacts.dir>
</properties>
<dependencies>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>openapi</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>annotations</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>util</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>extensions</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>jdom</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>maven</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>maven-server-api</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>idea</artifactId>
<version>${idea.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm.idea</groupId>
<artifactId>teavm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-jps-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-jps-plugin</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>../../checkstyle.xml</configLocation>
<propertyExpansion>config_loc=${basedir}/../../../</propertyExpansion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/assembly/plugin.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,56 @@
<!--
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>idea-plugin</id>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<includes>
<include>org.teavm.idea:teavm:*</include>
</includes>
<outputFileNameMapping>teavm.jar</outputFileNameMapping>
</dependencySet>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<includes>
<include>org.teavm:teavm-jps-common</include>
</includes>
<outputFileNameMapping>teavm-jps-common.jar</outputFileNameMapping>
</dependencySet>
<dependencySet>
<outputDirectory>lib/jps</outputDirectory>
<includes>
<include>org.teavm:teavm-jps-plugin</include>
</includes>
<outputFileNameMapping>teavm-jps-plugin.jar</outputFileNameMapping>
</dependencySet>
</dependencySets>
<files>
<file>
<outputDirectory>lib</outputDirectory>
<source>target/${project.artifactId}-${project.version}.jar</source>
<destName>teavm-plugin.jar</destName>
</file>
</files>
</assembly>

View File

@ -40,7 +40,7 @@ import org.teavm.idea.jps.remote.TeaVMElementLocation;
public class TeaVMJPSRemoteService extends UnicastRemoteObject implements ApplicationComponent, TeaVMBuilderAssistant {
private static final int MIN_PORT = 10000;
private static final int MAX_PORT = 1 << 16;
private final ProjectManager projectManager = ProjectManager.getInstance();
private ProjectManager projectManager;
private int port;
private Registry registry;
@ -48,6 +48,13 @@ public class TeaVMJPSRemoteService extends UnicastRemoteObject implements Applic
super();
}
private synchronized ProjectManager getProjectManager() {
if (projectManager == null) {
projectManager = ProjectManager.getInstance();
}
return projectManager;
}
@Override
public void initComponent() {
Random random = new Random();
@ -94,7 +101,7 @@ public class TeaVMJPSRemoteService extends UnicastRemoteObject implements Applic
TeaVMElementLocation[] resultHolder = new TeaVMElementLocation[1];
ApplicationManager.getApplication().runReadAction(() -> {
for (Project project : projectManager.getOpenProjects()) {
for (Project project : getProjectManager().getOpenProjects()) {
JavaPsiFacade psi = JavaPsiFacade.getInstance(project);
PsiClass cls = psi.findClass(className, GlobalSearchScope.allScope(project));
if (cls == null) {

View File

@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>org.teavm.idea</id>
<name>TeaVM IDEA plugin</name>
<version>1.0</version>
<version>${project.version}</version>
<vendor email="info@teavm.org" url="http://teavm.org">TeaVM community</vendor>
<depends>org.jetbrains.idea.maven</depends>
@ -17,7 +17,7 @@
]]>
</change-notes>
<idea-version since-build="141.0"/>
<idea-version since-build="163.12024.16"/>
<application-components>
<component>
@ -26,7 +26,7 @@
</application-components>
<extensions defaultExtensionNs="com.intellij">
<compileServer.plugin classpath="jps/teavm-jps-plugin.jar;teavm-all.jar;teavm-jps-common.jar"/>
<compileServer.plugin classpath="jps/teavm-jps-plugin.jar;teavm.jar;teavm-jps-common.jar"/>
<buildProcess.parametersProvider implementation="org.teavm.idea.TeaVMJPSConfigurator"/>
<configurationType implementation="org.teavm.idea.debug.TeaVMDebugConfigurationType"/>
<programRunner implementation="org.teavm.idea.debug.TeaVMDebugRunner"/>

View File

Before

Width:  |  Height:  |  Size: 713 B

After

Width:  |  Height:  |  Size: 713 B

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PLUGIN_MODULE" version="4">
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/src/main/resources/META-INF/plugin.xml" />
<component name="NewModuleRootManager" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
@ -12,7 +11,16 @@
</content>
<orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="teavm-jps-common" exported="" />
<orderEntry type="module" module-name="teavm-jps-plugin" exported="" />
<orderEntry type="module" module-name="teavm-jps-common" />
<orderEntry type="module" module-name="teavm-jps-plugin" exported="" scope="RUNTIME" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../idea-artifacts/dependencies/teavm.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

50
tools/idea/pom.xml Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>teavm</artifactId>
<groupId>org.teavm</groupId>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teavm-idea-parent</artifactId>
<name>TeaVM IDEA plugin parent</name>
<packaging>pom</packaging>
<properties>
<idea.artifacts.dir>${basedir}</idea.artifacts.dir>
</properties>
<repositories>
<repository>
<id>IDEA</id>
<url>file://${idea.artifacts.dir}/idea-artifacts/dependencies/maven</url>
</repository>
</repositories>
<modules>
<module>idea-artifacts</module>
<module>jps-common</module>
<module>jps-plugin</module>
<module>plugin</module>
</modules>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

90
tools/idea/teavm/pom.xml Normal file
View File

@ -0,0 +1,90 @@
<!--
~ Copyright 2017 Alexey Andreev.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.teavm</groupId>
<artifactId>teavm</artifactId>
<version>0.5.0-SNAPSHOT</version>
<relativePath>../../..</relativePath>
</parent>
<artifactId>teavm-idea-jps-repack</artifactId>
<dependencies>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-tooling</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-chrome-rdp</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-metaprogramming-impl</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
</relocations>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="teavm-tooling" />
<orderEntry type="module" module-name="teavm-core" />
<orderEntry type="module" module-name="teavm-interop" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-debug-all:5.0.4" level="project" />
<orderEntry type="library" name="Maven: com.carrotsearch:hppc:0.6.1" level="project" />
<orderEntry type="module" module-name="teavm-chrome-rdp" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-http:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-util:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-io:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:javax-websocket-server-impl:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-annotations:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-plus:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-jndi:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-webapp:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-xml:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.2" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.1" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-commons:5.0.1" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-tree:5.0.1" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:javax-websocket-client-impl:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-client:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-server:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-common:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-api:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-servlet:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-servlet:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-security:9.2.1.v20140609" level="project" />
<orderEntry type="library" name="Maven: javax.websocket:javax.websocket-api:1.0" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" />
<orderEntry type="module" module-name="teavm-metaprogramming-impl" />
<orderEntry type="module" module-name="teavm-metaprogramming-api" />
</component>
</module>