From 1ee07e89bc0a2a2fe4ffba954123ddfbb79f28b4 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Thu, 18 Feb 2016 01:17:37 +0300 Subject: [PATCH] First working version of JPS plugin --- .idea/libraries/teavm_all.xml | 12 ++++ .idea/libraries/teavm_core_1_0_0_SNAPSHOT.xml | 9 --- .../teavm_tooling_1_0_0_SNAPSHOT.xml | 9 --- .../install_artifacts_for_idea.xml | 7 -- .../install_core_artifact.xml | 27 -------- .../install_tooling_artifact.xml | 27 -------- core/pom.xml | 27 -------- tools/idea/jps-plugin/.gitignore | 1 + tools/idea/jps-plugin/pom.xml | 65 +++++++++++++++++++ .../java/org/teavm/idea/jps/TeaVMBuilder.java | 1 + .../teavm/idea/jps/TeaVMBuilderService.java | 14 ++++ tools/idea/jps-plugin/teavm-jps-plugin.iml | 6 +- .../src/main/resources/META-INF/plugin.xml | 2 +- tools/idea/teavm-idea-plugin.iml | 7 +- 14 files changed, 98 insertions(+), 116 deletions(-) create mode 100644 .idea/libraries/teavm_all.xml delete mode 100644 .idea/libraries/teavm_core_1_0_0_SNAPSHOT.xml delete mode 100644 .idea/libraries/teavm_tooling_1_0_0_SNAPSHOT.xml delete mode 100644 .idea/runConfigurations/install_artifacts_for_idea.xml delete mode 100644 .idea/runConfigurations/install_core_artifact.xml delete mode 100644 .idea/runConfigurations/install_tooling_artifact.xml create mode 100644 tools/idea/jps-plugin/.gitignore create mode 100644 tools/idea/jps-plugin/pom.xml diff --git a/.idea/libraries/teavm_all.xml b/.idea/libraries/teavm_all.xml new file mode 100644 index 000000000..55f1409ea --- /dev/null +++ b/.idea/libraries/teavm_all.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/teavm_core_1_0_0_SNAPSHOT.xml b/.idea/libraries/teavm_core_1_0_0_SNAPSHOT.xml deleted file mode 100644 index 0020c2209..000000000 --- a/.idea/libraries/teavm_core_1_0_0_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/teavm_tooling_1_0_0_SNAPSHOT.xml b/.idea/libraries/teavm_tooling_1_0_0_SNAPSHOT.xml deleted file mode 100644 index fc8ee2eca..000000000 --- a/.idea/libraries/teavm_tooling_1_0_0_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/install_artifacts_for_idea.xml b/.idea/runConfigurations/install_artifacts_for_idea.xml deleted file mode 100644 index 7a8853f9b..000000000 --- a/.idea/runConfigurations/install_artifacts_for_idea.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/install_core_artifact.xml b/.idea/runConfigurations/install_core_artifact.xml deleted file mode 100644 index efd598046..000000000 --- a/.idea/runConfigurations/install_core_artifact.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/install_tooling_artifact.xml b/.idea/runConfigurations/install_tooling_artifact.xml deleted file mode 100644 index 6998c9525..000000000 --- a/.idea/runConfigurations/install_tooling_artifact.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/pom.xml b/core/pom.xml index 1199992a2..92c112da5 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -72,33 +72,6 @@ org.apache.maven.plugins maven-javadoc-plugin - - org.apache.maven.plugins - maven-shade-plugin - 2.4.3 - - - package - - shade - - - true - - - org.ow2.asm:asm-debug-all - - - - - org.objectweb.asm - org.teavm.asm - - - - - - org.apache.felix maven-bundle-plugin diff --git a/tools/idea/jps-plugin/.gitignore b/tools/idea/jps-plugin/.gitignore new file mode 100644 index 000000000..f1ff06d60 --- /dev/null +++ b/tools/idea/jps-plugin/.gitignore @@ -0,0 +1 @@ +lib/ \ No newline at end of file diff --git a/tools/idea/jps-plugin/pom.xml b/tools/idea/jps-plugin/pom.xml new file mode 100644 index 000000000..66ec62bc4 --- /dev/null +++ b/tools/idea/jps-plugin/pom.xml @@ -0,0 +1,65 @@ + + + 4.0.0 + + + org.teavm + teavm + 1.0.0-SNAPSHOT + ../../.. + + pom + + teavm-jps-repack + + + + org.teavm + teavm-tooling + ${project.version} + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 2.4.3 + + + package + + shade + + + lib/teavm-all.jar + + + org.objectweb.asm + org.teavm.asm + + + + + + + + + \ No newline at end of file diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilder.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilder.java index fdd677c65..c93b008cb 100644 --- a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilder.java +++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilder.java @@ -83,6 +83,7 @@ public class TeaVMBuilder extends ModuleLevelBuilder { tool.setSourceMapsFileGenerated(true); tool.setTargetDirectory(new File(config.getTargetDirectory())); tool.setClassLoader(buildClassLoader(module)); + tool.setMinifying(false); try { tool.generate(); diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilderService.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilderService.java index ef1bc191b..96725390c 100644 --- a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilderService.java +++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilderService.java @@ -15,8 +15,11 @@ */ package org.teavm.idea.jps; +import java.io.IOException; +import java.net.URL; import java.util.Arrays; import java.util.Collections; +import java.util.Enumeration; import java.util.List; import org.jetbrains.annotations.NotNull; import org.jetbrains.jps.incremental.BuilderService; @@ -27,6 +30,17 @@ public class TeaVMBuilderService extends BuilderService { @NotNull @Override public List createModuleLevelBuilders() { + try { + Enumeration resources = TeaVMBuilderService.class.getClassLoader().getResources( + "org/objectweb/asm/ClassVisitor.class"); + while (resources.hasMoreElements()) { + URL url = resources.nextElement(); + System.out.println(url); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + System.out.println(); return Arrays.asList(new TeaVMBuilder()); } diff --git a/tools/idea/jps-plugin/teavm-jps-plugin.iml b/tools/idea/jps-plugin/teavm-jps-plugin.iml index b50dcbc95..dec22f577 100644 --- a/tools/idea/jps-plugin/teavm-jps-plugin.iml +++ b/tools/idea/jps-plugin/teavm-jps-plugin.iml @@ -11,9 +11,7 @@ - - - - + + \ No newline at end of file diff --git a/tools/idea/src/main/resources/META-INF/plugin.xml b/tools/idea/src/main/resources/META-INF/plugin.xml index a5ffd49d2..cf8390e39 100644 --- a/tools/idea/src/main/resources/META-INF/plugin.xml +++ b/tools/idea/src/main/resources/META-INF/plugin.xml @@ -21,7 +21,7 @@ - + diff --git a/tools/idea/teavm-idea-plugin.iml b/tools/idea/teavm-idea-plugin.iml index c91659d49..33bdc0471 100644 --- a/tools/idea/teavm-idea-plugin.iml +++ b/tools/idea/teavm-idea-plugin.iml @@ -12,10 +12,7 @@ - - - - - + + \ No newline at end of file