Skip to content

Commit

Permalink
extraSystemPath option
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrignon committed Aug 23, 2017
1 parent 3bd3bde commit 77da847
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jsweet {
candiesJsOut = new File('target/candies')
targetVersion = 'ES3'
includes = ['**/fr/test/my/**/*.java']
// extraSystemPath = '/my/path/to/npm'
}
```
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apply plugin: 'maven-publish-auth'
apply plugin: "com.gradle.plugin-publish"

group = 'org.jsweet'
version = '2.0.0-rc1'
version = '2.0.0-SNAPSHOT'
description = 'JSweet Gradle plugin'

sourceCompatibility = 1.8
Expand Down Expand Up @@ -45,7 +45,7 @@ dependencies {
compile gradleApi()
compile localGroovy()

compile group: 'org.jsweet', name: 'jsweet-transpiler', version:'2.0.0-rc1'
compile group: 'org.jsweet', name: 'jsweet-transpiler', version:'2.0.0-SNAPSHOT'
compile group: 'org.jsweet', name: 'jsweet-core', version:'5-20170726'
compile group: 'org.codehaus.plexus', name: 'plexus-utils', version:'3.0.20'
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/jsweet/gradle/JSweetPluginExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ public void setHeader(File header) {
this.header = header;
}

public String getExtraSystemPath() {
return extraSystemPath;
}

public void setExtraSystemPath(String extraSystemPath) {
this.extraSystemPath = extraSystemPath;
}

private EcmaScriptComplianceLevel targetVersion = EcmaScriptComplianceLevel.ES3;
private ModuleKind module = ModuleKind.none;
private File outDir;
Expand Down Expand Up @@ -239,6 +247,8 @@ public void setHeader(File header) {
private boolean disableSinglePrecisionFloats = false;
private String factoryClassName;

private String extraSystemPath;

protected boolean ignoreTypeScriptErrors;
protected File header;
}
8 changes: 8 additions & 0 deletions src/main/java/org/jsweet/gradle/JSweetTranspileTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.jsweet.gradle;

import static org.apache.commons.lang3.StringUtils.isNotBlank;

import java.io.File;
import java.util.Collection;
import java.util.LinkedList;
Expand All @@ -35,6 +37,7 @@
import org.jsweet.transpiler.SourceFile;
import org.jsweet.transpiler.util.ConsoleTranspilationHandler;
import org.jsweet.transpiler.util.ErrorCountTranspilationHandler;
import org.jsweet.transpiler.util.ProcessUtil;

/**
* JSweet transpilation task
Expand Down Expand Up @@ -81,6 +84,11 @@ protected void transpile() {
new ConsoleTranspilationHandler());
try {

logInfo("extraSystemPath: " + configuration.getExtraSystemPath());
if (isNotBlank(configuration.getExtraSystemPath())) {
ProcessUtil.addExtraPath(configuration.getExtraSystemPath());
}

logInfo("encoding: " + configuration.getEncoding());
logInfo("classpath: " + classpath.getFiles());
logInfo("ts output dir: " + tsOutputDir);
Expand Down

0 comments on commit 77da847

Please sign in to comment.