Update build config to avoid jar hell

This commit is contained in:
Alexey Andreev 2018-11-22 14:49:30 +03:00
parent b4460b2282
commit 753755918d
20 changed files with 255 additions and 118 deletions

View File

@ -47,5 +47,11 @@
<option name="VARIABLE_ANNOTATION_WRAP" value="1" /> <option name="VARIABLE_ANNOTATION_WRAP" value="1" />
<option name="ENUM_CONSTANTS_WRAP" value="2" /> <option name="ENUM_CONSTANTS_WRAP" value="2" />
</codeStyleSettings> </codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
</code_scheme> </code_scheme>
</component> </component>

View File

@ -35,7 +35,7 @@ before_install:
- rm -rf $HOME/.m2 - rm -rf $HOME/.m2
install: 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 - pushd tests/src/test/js
- npm config set prefix=$HOME/.node_modules - npm config set prefix=$HOME/.node_modules
- npm install - npm install

View File

@ -24,8 +24,6 @@
</parent> </parent>
<artifactId>teavm-classlib</artifactId> <artifactId>teavm-classlib</artifactId>
<packaging>bundle</packaging>
<name>TeaVM Java class library</name> <name>TeaVM Java class library</name>
<description>TeaVM Java class library emulation</description> <description>TeaVM Java class library emulation</description>
@ -49,6 +47,7 @@
<artifactId>teavm-core</artifactId> <artifactId>teavm-core</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.teavm</groupId> <groupId>org.teavm</groupId>
@ -79,6 +78,7 @@
<groupId>org.ow2.asm</groupId> <groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId> <artifactId>asm-util</artifactId>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
@ -106,17 +106,6 @@
<configLocation>../checkstyle.xml</configLocation> <configLocation>../checkstyle.xml</configLocation>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.teavm.classlib.*</Export-Package>
<Bundle-SymbolicName>teavm-classlib</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
@ -125,6 +114,31 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>org.teavm:teavm-classlib</include>
</includes>
</artifactSet>
<relocations>
<relocation>cd
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -24,8 +24,6 @@
</parent> </parent>
<artifactId>teavm-core</artifactId> <artifactId>teavm-core</artifactId>
<packaging>bundle</packaging>
<name>TeaVM core</name> <name>TeaVM core</name>
<description>TeaVM compiler and SPI</description> <description>TeaVM compiler and SPI</description>
@ -48,19 +46,23 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ow2.asm</groupId> <groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId> <artifactId>asm-commons</artifactId>
<optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ow2.asm</groupId> <groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId> <artifactId>asm-util</artifactId>
<optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.carrotsearch</groupId> <groupId>com.carrotsearch</groupId>
<artifactId>hppc</artifactId> <artifactId>hppc</artifactId>
<version>0.7.3</version> <version>0.7.3</version>
<optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
@ -70,6 +72,7 @@
<dependency> <dependency>
<groupId>org.mozilla</groupId> <groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId> <artifactId>rhino</artifactId>
<optional>true</optional>
</dependency> </dependency>
</dependencies> </dependencies>
@ -90,16 +93,45 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.felix</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-bundle-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<extensions>true</extensions> <executions>
<configuration> <execution>
<instructions> <phase>package</phase>
<Export-Package>org.teavm.*</Export-Package> <goals>
<Bundle-SymbolicName>teavm-core</Bundle-SymbolicName> <goal>shade</goal>
</instructions> </goals>
</configuration> <configuration>
<artifactSet>
<excludes>
<exclude>junit:junit</exclude>
<exclude>org:teavm:*</exclude>
<exclude>com.fasterxml.jackson.core:jackson-annotations</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
<relocation>
<pattern>org.mozilla</pattern>
<shadedPattern>org.teavm.rhino</shadedPattern>
</relocation>
<relocation>
<pattern>com.carrotsearch.hppc</pattern>
<shadedPattern>org.teavm.hppc</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>org.teavm.apachecommons</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -119,6 +119,10 @@ public class AstWriter {
nameMap.put(name, emitter); nameMap.put(name, emitter);
} }
public void hoist(Object node) {
hoist((AstNode) node);
}
public void hoist(AstNode node) { public void hoist(AstNode node) {
node.visit(n -> { node.visit(n -> {
if (n instanceof Scope) { 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 { public void print(AstNode node) throws IOException {
print(node, PRECEDENCE_COMMA); print(node, PRECEDENCE_COMMA);
} }

View File

@ -15,15 +15,25 @@
*/ */
package org.teavm.backend.javascript.rendering; package org.teavm.backend.javascript.rendering;
import java.io.IOException;
import java.io.Reader;
import org.mozilla.javascript.CompilerEnvirons; import org.mozilla.javascript.CompilerEnvirons;
import org.mozilla.javascript.ErrorReporter; import org.mozilla.javascript.ErrorReporter;
import org.mozilla.javascript.Parser; import org.mozilla.javascript.Parser;
public class JSParser extends Parser { public class JSParser extends Parser {
public JSParser(Object compilerEnv, Object errorReporter) {
this((CompilerEnvirons) compilerEnv, (ErrorReporter) errorReporter);
}
public JSParser(CompilerEnvirons compilerEnv, ErrorReporter errorReporter) { public JSParser(CompilerEnvirons compilerEnv, ErrorReporter errorReporter) {
super(compilerEnv, errorReporter); super(compilerEnv, errorReporter);
} }
public JSParser(Object compilerEnv) {
this((CompilerEnvirons) compilerEnv);
}
public JSParser(CompilerEnvirons compilerEnv) { public JSParser(CompilerEnvirons compilerEnv) {
super(compilerEnv); super(compilerEnv);
} }
@ -35,4 +45,8 @@ public class JSParser extends Parser {
public void exitFunction() { public void exitFunction() {
--nestingOfFunction; --nestingOfFunction;
} }
public Object parseAsObject(Reader sourceReader, String sourceURI, int lineno) throws IOException {
return parse(sourceReader, sourceURI, lineno);
}
} }

View File

@ -45,6 +45,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -65,6 +70,31 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>org.teavm:teavm-jso-impl</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.mozilla</pattern>
<shadedPattern>org.teavm.rhino</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -587,7 +587,7 @@ class JSClassProcessor {
JSParser parser = new JSParser(env, errorReporter); JSParser parser = new JSParser(env, errorReporter);
AstRoot rootNode; AstRoot rootNode;
try { try {
rootNode = parser.parse(new StringReader("function(){" + script + "}"), null, 0); rootNode = (AstRoot) parser.parseAsObject(new StringReader("function(){" + script + "}"), null, 0);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("IO Error occurred", e); throw new RuntimeException("IO Error occurred", e);
} }

View File

@ -28,8 +28,6 @@
</parent> </parent>
<artifactId>teavm-metaprogramming-api</artifactId> <artifactId>teavm-metaprogramming-api</artifactId>
<packaging>bundle</packaging>
<name>TeaVM metaprogramming API</name> <name>TeaVM metaprogramming API</name>
<description>Declaration of interfaces and annotations for TeaVM metaprogramming</description> <description>Declaration of interfaces and annotations for TeaVM metaprogramming</description>
@ -70,17 +68,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.teavm.metaprogramming.*</Export-Package>
<Bundle-SymbolicName>teavm-metaprogramming-api</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -28,8 +28,6 @@
<artifactId>teavm-metaprogramming-impl</artifactId> <artifactId>teavm-metaprogramming-impl</artifactId>
<packaging>bundle</packaging>
<name>TeaVM metaprogramming API implementation</name> <name>TeaVM metaprogramming API implementation</name>
<description>Implementation of metaprogramming API</description> <description>Implementation of metaprogramming API</description>
@ -45,6 +43,20 @@
<artifactId>teavm-metaprogramming-api</artifactId> <artifactId>teavm-metaprogramming-api</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
@ -82,15 +94,33 @@
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.felix</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-bundle-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<extensions>true</extensions> <executions>
<configuration> <execution>
<instructions> <phase>package</phase>
<Export-Package>org.teavm.metaprogramming.*</Export-Package> <goals>
<Bundle-SymbolicName>teavm-metaprogramming-api</Bundle-SymbolicName> <goal>shade</goal>
</instructions> </goals>
</configuration> <configuration>
<artifactSet>
<includes>
<include>org.teavm:teavm-metaprogramming-impl</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>org.teavm.apachecommons</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -24,8 +24,6 @@
</parent> </parent>
<artifactId>teavm-platform</artifactId> <artifactId>teavm-platform</artifactId>
<packaging>bundle</packaging>
<name>TeaVM platform</name> <name>TeaVM platform</name>
<description>A low-level classes that help to implement Java class library</description> <description>A low-level classes that help to implement Java class library</description>
@ -50,17 +48,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.teavm.platform.*</Export-Package>
<Bundle-SymbolicName>teavm-platform</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId> <artifactId>maven-checkstyle-plugin</artifactId>

10
pom.xml
View File

@ -208,6 +208,11 @@
<artifactId>rhino</artifactId> <artifactId>rhino</artifactId>
<version>${rhino.version}</version> <version>${rhino.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -287,11 +292,6 @@
<configLocation>../checkstyle.xml</configLocation> <configLocation>../checkstyle.xml</configLocation>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.1.0</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>

View File

@ -77,6 +77,12 @@
<version>${project.version}</version> <version>${project.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>hppc</artifactId>
<version>0.7.3</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -25,8 +25,6 @@
</parent> </parent>
<artifactId>teavm-chrome-rdp</artifactId> <artifactId>teavm-chrome-rdp</artifactId>
<packaging>bundle</packaging>
<name>TeaVM debugging backend for Google Chrome RDP</name> <name>TeaVM debugging backend for Google Chrome RDP</name>
<description>TeaVM debugging backend for Google Chrome RDP</description> <description>TeaVM debugging backend for Google Chrome RDP</description>
@ -82,17 +80,6 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.teavm.chromerdp</Export-Package>
<Bundle-SymbolicName>teavm-chrome-rdp</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -93,7 +93,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>

View File

@ -24,7 +24,6 @@
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<artifactId>teavm-tooling</artifactId> <artifactId>teavm-tooling</artifactId>
<packaging>bundle</packaging>
<name>TeaVM tooling core</name> <name>TeaVM tooling core</name>
<description>TeaVM API that helps to create tooling</description> <description>TeaVM API that helps to create tooling</description>
@ -40,6 +39,11 @@
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -60,16 +64,43 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.felix</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-bundle-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<extensions>true</extensions> <executions>
<configuration> <execution>
<instructions> <phase>package</phase>
<Export-Package>org.teavm.*</Export-Package> <goals>
<Bundle-SymbolicName>teavm-tooling</Bundle-SymbolicName> <goal>shade</goal>
</instructions> </goals>
</configuration> <configuration>
<artifactSet>
<includes>
<include>org.teavm:teavm-tooling</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.teavm.asm</shadedPattern>
</relocation>
<relocation>
<pattern>org.mozilla</pattern>
<shadedPattern>org.teavm.rhino</shadedPattern>
</relocation>
<relocation>
<pattern>com.carrotsearch.hppc</pattern>
<shadedPattern>org.teavm.hppc</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>org.teavm.apachecommons</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -62,11 +62,6 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-metaprogramming-impl</artifactId>
<version>${teavm.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -128,16 +123,6 @@
<exclude>com.jetbrains.intellij.idea:ideaIC:zip:*</exclude> <exclude>com.jetbrains.intellij.idea:ideaIC:zip:*</exclude>
</excludes> </excludes>
</atrifactSet> </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> <createDependencyReducedPom>false</createDependencyReducedPom>
<outputFile>dependencies/teavm.jar</outputFile> <outputFile>dependencies/teavm.jar</outputFile>
</configuration> </configuration>

View File

@ -74,6 +74,12 @@ import org.teavm.vm.TeaVMProgressFeedback;
import org.teavm.vm.TeaVMProgressListener; import org.teavm.vm.TeaVMProgressListener;
class TeaVMBuild { 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 CompileContext context;
private final List<String> classPathEntries = new ArrayList<>(); private final List<String> classPathEntries = new ArrayList<>();
private List<String> directoryClassPathEntries; private List<String> directoryClassPathEntries;
@ -83,13 +89,15 @@ class TeaVMBuild {
private final Map<File, int[]> fileLineCache = new HashMap<>(); private final Map<File, int[]> fileLineCache = new HashMap<>();
private BuildStrategy buildStrategy; private BuildStrategy buildStrategy;
private BuildOutputConsumer outputConsumer; private BuildOutputConsumer outputConsumer;
private boolean incrementaSupported;
TeaVMBuild(CompileContext context, TeaVMBuilderAssistant assistant, BuildStrategy buildStrategy, TeaVMBuild(CompileContext context, TeaVMBuilderAssistant assistant, BuildStrategy buildStrategy,
BuildOutputConsumer outputConsumer) { BuildOutputConsumer outputConsumer, boolean incrementalSupported) {
this.context = context; this.context = context;
this.assistant = assistant; this.assistant = assistant;
this.buildStrategy = buildStrategy; this.buildStrategy = buildStrategy;
this.outputConsumer = outputConsumer; this.outputConsumer = outputConsumer;
this.incrementaSupported = incrementalSupported;
} }
boolean perform(JpsModule module, TeaVMBuildTarget target) throws IOException, BuildException { boolean perform(JpsModule module, TeaVMBuildTarget target) throws IOException, BuildException {
@ -122,7 +130,7 @@ class TeaVMBuild {
buildStrategy.setTargetType(config.getTargetType()); buildStrategy.setTargetType(config.getTargetType());
buildStrategy.setTargetDirectory(config.getTargetDirectory()); buildStrategy.setTargetDirectory(config.getTargetDirectory());
buildStrategy.setProgressListener(createProgressListener(context)); buildStrategy.setProgressListener(createProgressListener(context));
buildStrategy.setIncremental(!isRebuild(target)); buildStrategy.setIncremental(incrementaSupported && !isRebuild(target));
Properties properties = new Properties(); Properties properties = new Properties();
for (TeaVMProperty property : config.getProperties()) { for (TeaVMProperty property : config.getProperties()) {
@ -484,7 +492,7 @@ class TeaVMBuild {
JpsModuleDependency moduleDependency = (JpsModuleDependency) dependency; JpsModuleDependency moduleDependency = (JpsModuleDependency) dependency;
File dependencyOutput = JpsJavaExtensionService.getInstance().getOutputDirectory( File dependencyOutput = JpsJavaExtensionService.getInstance().getOutputDirectory(
moduleDependency.getModule(), false); moduleDependency.getModule(), false);
if (dependencyOutput != null) { if (dependencyOutput != null && !isBlacklistedDependency(dependencyOutput)) {
classPathEntries.add(dependencyOutput.getPath()); classPathEntries.add(dependencyOutput.getPath());
} }
for (JpsModuleSourceRoot sourceRoot : moduleDependency.getModule().getSourceRoots()) { 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) { private File getFileFromUrl(String url) {
if (url.startsWith("file://")) { if (url.startsWith("file://")) {
return new File(url.substring("file://".length())); return new File(url.substring("file://".length()));

View File

@ -77,7 +77,7 @@ public class TeaVMBuilder extends TargetBuilder<BuildRootDescriptor, TeaVMBuildT
BuildStrategy buildStrategy = buildService != null BuildStrategy buildStrategy = buildService != null
? new RemoteBuildStrategy(buildService) ? new RemoteBuildStrategy(buildService)
: createInProcessBuilder(); : createInProcessBuilder();
TeaVMBuild build = new TeaVMBuild(context, assistant, buildStrategy, outputConsumer); TeaVMBuild build = new TeaVMBuild(context, assistant, buildStrategy, outputConsumer, buildService != null);
build.perform(target.getModule(), target); build.perform(target.getModule(), target);
} catch (BuildException e) { } catch (BuildException e) {

View File

@ -29,10 +29,10 @@ curl --ftp-create-dirs -T .idea-repository.xml \
# #
# Upload Eclipse plugin # Upload Eclipse plugin
# #
cd tools/eclipse/updatesite/target/repository #cd tools/eclipse/updatesite/target/repository
find . -type f -exec curl \ # find . -type f -exec curl \
--ftp-create-dirs \ # --ftp-create-dirs \
-u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD \ # -u $TEAVM_FTP_LOGIN:$TEAVM_FTP_PASSWORD \
-T {} \ # -T {} \
ftp://$TEAVM_FTP_HOST/httpdocs/eclipse/update-site/$BASE_VERSION-dev/{} \; # ftp://$TEAVM_FTP_HOST/httpdocs/eclipse/update-site/$BASE_VERSION-dev/{} \;
cd ../../../../.. #cd ../../../../..