diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index be4d48af6..96ef064cb 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -47,5 +47,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 3d18112ff..b924ce2f2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,7 +35,7 @@ before_install:
- rm -rf $HOME/.m2
install:
- - $MVN_CMD install -Dteavm.build.all=false -P with-idea -P with-eclipse -P with-cli -DskipTests=true -Dmaven.javadoc.skip=true -V
+ - $MVN_CMD install -Dteavm.build.all=false -P with-idea -P with-cli -DskipTests=true -Dmaven.javadoc.skip=true -V
- pushd tests/src/test/js
- npm config set prefix=$HOME/.node_modules
- npm install
diff --git a/classlib/pom.xml b/classlib/pom.xml
index 53898bc71..931e108c5 100644
--- a/classlib/pom.xml
+++ b/classlib/pom.xml
@@ -24,8 +24,6 @@
teavm-classlib
- bundle
-
TeaVM Java class library
TeaVM Java class library emulation
@@ -49,6 +47,7 @@
teavm-core
${project.version}
provided
+ true
org.teavm
@@ -79,6 +78,7 @@
org.ow2.asm
asm-util
provided
+ true
com.google.code.gson
@@ -106,17 +106,6 @@
../checkstyle.xml
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- org.teavm.classlib.*
- teavm-classlib
-
-
-
org.apache.maven.plugins
maven-source-plugin
@@ -125,6 +114,31 @@
org.apache.maven.plugins
maven-javadoc-plugin
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+
+
+ package
+
+ shade
+
+
+
+
+ org.teavm:teavm-classlib
+
+
+
+ cd
+ org.objectweb.asm
+ org.teavm.asm
+
+
+
+
+
+
diff --git a/core/pom.xml b/core/pom.xml
index 55ef9818f..a5968d1d5 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -24,8 +24,6 @@
teavm-core
- bundle
-
TeaVM core
TeaVM compiler and SPI
@@ -48,19 +46,23 @@
commons-io
commons-io
+ true
org.ow2.asm
asm-commons
+ true
org.ow2.asm
asm-util
+ true
com.carrotsearch
hppc
0.7.3
+ true
com.fasterxml.jackson.core
@@ -70,6 +72,7 @@
org.mozilla
rhino
+ true
@@ -90,16 +93,45 @@
org.apache.maven.plugins
maven-javadoc-plugin
+
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- org.teavm.*
- teavm-core
-
-
+ org.apache.maven.plugins
+ maven-shade-plugin
+
+
+ package
+
+ shade
+
+
+
+
+ junit:junit
+ org:teavm:*
+ com.fasterxml.jackson.core:jackson-annotations
+
+
+
+
+ org.objectweb.asm
+ org.teavm.asm
+
+
+ org.mozilla
+ org.teavm.rhino
+
+
+ com.carrotsearch.hppc
+ org.teavm.hppc
+
+
+ org.apache.commons
+ org.teavm.apachecommons
+
+
+
+
+
diff --git a/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java b/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java
index 6351181b4..04fdcc6f0 100644
--- a/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java
+++ b/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java
@@ -119,6 +119,10 @@ public class AstWriter {
nameMap.put(name, emitter);
}
+ public void hoist(Object node) {
+ hoist((AstNode) node);
+ }
+
public void hoist(AstNode node) {
node.visit(n -> {
if (n instanceof Scope) {
@@ -133,6 +137,14 @@ public class AstWriter {
});
}
+ public void print(Object node) throws IOException {
+ print((AstNode) node);
+ }
+
+ public void print(Object node, int precedence) throws IOException {
+ print((AstNode) node, precedence);
+ }
+
public void print(AstNode node) throws IOException {
print(node, PRECEDENCE_COMMA);
}
diff --git a/core/src/main/java/org/teavm/backend/javascript/rendering/JSParser.java b/core/src/main/java/org/teavm/backend/javascript/rendering/JSParser.java
index 05b75bff3..52398b508 100644
--- a/core/src/main/java/org/teavm/backend/javascript/rendering/JSParser.java
+++ b/core/src/main/java/org/teavm/backend/javascript/rendering/JSParser.java
@@ -15,15 +15,25 @@
*/
package org.teavm.backend.javascript.rendering;
+import java.io.IOException;
+import java.io.Reader;
import org.mozilla.javascript.CompilerEnvirons;
import org.mozilla.javascript.ErrorReporter;
import org.mozilla.javascript.Parser;
public class JSParser extends Parser {
+ public JSParser(Object compilerEnv, Object errorReporter) {
+ this((CompilerEnvirons) compilerEnv, (ErrorReporter) errorReporter);
+ }
+
public JSParser(CompilerEnvirons compilerEnv, ErrorReporter errorReporter) {
super(compilerEnv, errorReporter);
}
+ public JSParser(Object compilerEnv) {
+ this((CompilerEnvirons) compilerEnv);
+ }
+
public JSParser(CompilerEnvirons compilerEnv) {
super(compilerEnv);
}
@@ -35,4 +45,8 @@ public class JSParser extends Parser {
public void exitFunction() {
--nestingOfFunction;
}
+
+ public Object parseAsObject(Reader sourceReader, String sourceURI, int lineno) throws IOException {
+ return parse(sourceReader, sourceURI, lineno);
+ }
}
diff --git a/jso/impl/pom.xml b/jso/impl/pom.xml
index 0d58066fc..017f8da9f 100644
--- a/jso/impl/pom.xml
+++ b/jso/impl/pom.xml
@@ -45,6 +45,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
junit
test
+
+ org.mozilla
+ rhino
+ true
+
@@ -65,6 +70,31 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
org.apache.maven.plugins
maven-javadoc-plugin
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+
+
+ package
+
+ shade
+
+
+
+
+ org.teavm:teavm-jso-impl
+
+
+
+
+ org.mozilla
+ org.teavm.rhino
+
+
+
+
+
+
\ No newline at end of file
diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java
index 113b2743e..bc259f6eb 100644
--- a/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java
+++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java
@@ -587,7 +587,7 @@ class JSClassProcessor {
JSParser parser = new JSParser(env, errorReporter);
AstRoot rootNode;
try {
- rootNode = parser.parse(new StringReader("function(){" + script + "}"), null, 0);
+ rootNode = (AstRoot) parser.parseAsObject(new StringReader("function(){" + script + "}"), null, 0);
} catch (IOException e) {
throw new RuntimeException("IO Error occurred", e);
}
diff --git a/metaprogramming/api/pom.xml b/metaprogramming/api/pom.xml
index 45a59b5bf..e0a6a43df 100644
--- a/metaprogramming/api/pom.xml
+++ b/metaprogramming/api/pom.xml
@@ -28,8 +28,6 @@
teavm-metaprogramming-api
- bundle
-
TeaVM metaprogramming API
Declaration of interfaces and annotations for TeaVM metaprogramming
@@ -70,17 +68,6 @@
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- org.teavm.metaprogramming.*
- teavm-metaprogramming-api
-
-
-
\ No newline at end of file
diff --git a/metaprogramming/impl/pom.xml b/metaprogramming/impl/pom.xml
index 009228526..540698127 100644
--- a/metaprogramming/impl/pom.xml
+++ b/metaprogramming/impl/pom.xml
@@ -28,8 +28,6 @@
teavm-metaprogramming-impl
- bundle
-
TeaVM metaprogramming API implementation
Implementation of metaprogramming API
@@ -45,6 +43,20 @@
teavm-metaprogramming-api
${project.version}
+
+ commons-io
+ commons-io
+
+
+ org.ow2.asm
+ asm-commons
+ true
+
+
+ org.ow2.asm
+ asm-util
+ true
+
junit
junit
@@ -82,15 +94,33 @@
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- org.teavm.metaprogramming.*
- teavm-metaprogramming-api
-
-
+ org.apache.maven.plugins
+ maven-shade-plugin
+
+
+ package
+
+ shade
+
+
+
+
+ org.teavm:teavm-metaprogramming-impl
+
+
+
+
+ org.objectweb.asm
+ org.teavm.asm
+
+
+ org.apache.commons
+ org.teavm.apachecommons
+
+
+
+
+
diff --git a/platform/pom.xml b/platform/pom.xml
index f253a7922..8f96204b7 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -24,8 +24,6 @@
teavm-platform
- bundle
-
TeaVM platform
A low-level classes that help to implement Java class library
@@ -50,17 +48,6 @@
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- org.teavm.platform.*
- teavm-platform
-
-
-
org.apache.maven.plugins
maven-checkstyle-plugin
diff --git a/pom.xml b/pom.xml
index 91679395c..195f5d0fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -208,6 +208,11 @@
rhino
${rhino.version}
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.1.1
+
@@ -287,11 +292,6 @@
../checkstyle.xml
-
- org.apache.felix
- maven-bundle-plugin
- 4.1.0
-
org.apache.maven.plugins
maven-jar-plugin
diff --git a/tests/pom.xml b/tests/pom.xml
index 52137adc9..10ee9d67e 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -77,6 +77,12 @@
${project.version}
test
+
+ com.carrotsearch
+ hppc
+ 0.7.3
+ test
+
diff --git a/tools/chrome-rdp/pom.xml b/tools/chrome-rdp/pom.xml
index 962218ef3..d9d84ade4 100644
--- a/tools/chrome-rdp/pom.xml
+++ b/tools/chrome-rdp/pom.xml
@@ -25,8 +25,6 @@
teavm-chrome-rdp
- bundle
-
TeaVM debugging backend for Google Chrome RDP
TeaVM debugging backend for Google Chrome RDP
@@ -82,17 +80,6 @@
org.apache.maven.plugins
maven-javadoc-plugin
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- org.teavm.chromerdp
- teavm-chrome-rdp
-
-
-
\ No newline at end of file
diff --git a/tools/cli/pom.xml b/tools/cli/pom.xml
index 56c4a098f..a07051509 100644
--- a/tools/cli/pom.xml
+++ b/tools/cli/pom.xml
@@ -93,7 +93,6 @@
org.apache.maven.plugins
maven-shade-plugin
- 3.1.0
package
diff --git a/tools/core/pom.xml b/tools/core/pom.xml
index ff2de9a53..02ed03291 100644
--- a/tools/core/pom.xml
+++ b/tools/core/pom.xml
@@ -24,7 +24,6 @@
../..
teavm-tooling
- bundle
TeaVM tooling core
TeaVM API that helps to create tooling
@@ -40,6 +39,11 @@
jackson-annotations
true
+
+ commons-io
+ commons-io
+ true
+
@@ -60,16 +64,43 @@
org.apache.maven.plugins
maven-javadoc-plugin
+
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- org.teavm.*
- teavm-tooling
-
-
+ org.apache.maven.plugins
+ maven-shade-plugin
+
+
+ package
+
+ shade
+
+
+
+
+ org.teavm:teavm-tooling
+
+
+
+
+ org.objectweb.asm
+ org.teavm.asm
+
+
+ org.mozilla
+ org.teavm.rhino
+
+
+ com.carrotsearch.hppc
+ org.teavm.hppc
+
+
+ org.apache.commons
+ org.teavm.apachecommons
+
+
+
+
+
diff --git a/tools/idea/idea-artifacts/dep-pom.xml b/tools/idea/idea-artifacts/dep-pom.xml
index da89aa875..7f01c8492 100644
--- a/tools/idea/idea-artifacts/dep-pom.xml
+++ b/tools/idea/idea-artifacts/dep-pom.xml
@@ -62,11 +62,6 @@
-
- org.teavm
- teavm-metaprogramming-impl
- ${teavm.version}
-
@@ -128,16 +123,6 @@
com.jetbrains.intellij.idea:ideaIC:zip:*
-
-
- org.objectweb.asm
- org.teavm.asm
-
-
- org.objectweb.asm
- org.teavm.asm
-
-
false
dependencies/teavm.jar
diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java
index 4f6341298..1950e3425 100644
--- a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java
+++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java
@@ -74,6 +74,12 @@ import org.teavm.vm.TeaVMProgressFeedback;
import org.teavm.vm.TeaVMProgressListener;
class TeaVMBuild {
+ private static final String[] BLACKLISTED_CLASSES = {
+ "org/teavm/jso/impl/JSOPlugin.class",
+ "org/teavm/metaprogramming/impl/MetaprogrammingImpl.class",
+ "org/teavm/classlib/impl/JCLPlugin.class"
+ };
+
private final CompileContext context;
private final List classPathEntries = new ArrayList<>();
private List directoryClassPathEntries;
@@ -83,13 +89,15 @@ class TeaVMBuild {
private final Map fileLineCache = new HashMap<>();
private BuildStrategy buildStrategy;
private BuildOutputConsumer outputConsumer;
+ private boolean incrementaSupported;
TeaVMBuild(CompileContext context, TeaVMBuilderAssistant assistant, BuildStrategy buildStrategy,
- BuildOutputConsumer outputConsumer) {
+ BuildOutputConsumer outputConsumer, boolean incrementalSupported) {
this.context = context;
this.assistant = assistant;
this.buildStrategy = buildStrategy;
this.outputConsumer = outputConsumer;
+ this.incrementaSupported = incrementalSupported;
}
boolean perform(JpsModule module, TeaVMBuildTarget target) throws IOException, BuildException {
@@ -122,7 +130,7 @@ class TeaVMBuild {
buildStrategy.setTargetType(config.getTargetType());
buildStrategy.setTargetDirectory(config.getTargetDirectory());
buildStrategy.setProgressListener(createProgressListener(context));
- buildStrategy.setIncremental(!isRebuild(target));
+ buildStrategy.setIncremental(incrementaSupported && !isRebuild(target));
Properties properties = new Properties();
for (TeaVMProperty property : config.getProperties()) {
@@ -484,7 +492,7 @@ class TeaVMBuild {
JpsModuleDependency moduleDependency = (JpsModuleDependency) dependency;
File dependencyOutput = JpsJavaExtensionService.getInstance().getOutputDirectory(
moduleDependency.getModule(), false);
- if (dependencyOutput != null) {
+ if (dependencyOutput != null && !isBlacklistedDependency(dependencyOutput)) {
classPathEntries.add(dependencyOutput.getPath());
}
for (JpsModuleSourceRoot sourceRoot : moduleDependency.getModule().getSourceRoots()) {
@@ -512,6 +520,15 @@ class TeaVMBuild {
}
}
+ private static boolean isBlacklistedDependency(File dependency) {
+ for (String entry : BLACKLISTED_CLASSES) {
+ if (new File(dependency, entry).exists()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private File getFileFromUrl(String url) {
if (url.startsWith("file://")) {
return new File(url.substring("file://".length()));
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 a38e4b626..d298aba1f 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
@@ -77,7 +77,7 @@ public class TeaVMBuilder extends TargetBuilder