Skip to content

Commit

Permalink
Merge branch 'feature/issue#9' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartolomeo Sorrentino authored and Bartolomeo Sorrentino committed May 9, 2019
2 parents 957c7d8 + c7684bf commit 0f6da11
Show file tree
Hide file tree
Showing 27 changed files with 931 additions and 2,046 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Java Processor to **generate [Typescript](https://www.typescriptlang.org/) Defi

## What is it for ?

This is to help developing on **JVM javascript engine**, either [Nashorn](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html) or [Rhino](https://github.com/mozilla/rhino) using [Typescript](https://www.typescriptlang.org/)
This is to help developing on **JVM javascript engine**, either [GraalJs](https://github.com/graalvm/graaljs), [Nashorn](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html) or [Rhino](https://github.com/mozilla/rhino) using [Typescript](https://www.typescriptlang.org/)

The main goal is having the definitions available in the modern IDE like [Visual Studio Code](https://code.visualstudio.com/) and [Atom](https://atom.io/) and then use the **intellisense** feature available for java classes within typescript

Expand Down
6 changes: 3 additions & 3 deletions archetype/tofilter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<configuration>
</configuration>
<executions>
<!--
<!--
mvn exec:exec@jjs
-->
<execution>
Expand Down Expand Up @@ -77,7 +77,7 @@
<code>2</code>
</successCodes>
-->

</configuration>
</execution>
</executions>
Expand All @@ -86,7 +86,7 @@
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.3</version>
<executions>
<execution>
<id>process</id>
Expand Down
89 changes: 57 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,35 @@
<artifactId>compiler</artifactId>
<version>0.9.4</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.bsc</groupId>
<artifactId>jvm-npm-core</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
Expand All @@ -120,31 +131,45 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
<configuration>
<parameters>true</parameters>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
<outputDirectory>${project.build.directory}/apidocs</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
<outputDirectory>${project.build.directory}/apidocs</outputDirectory>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
</plugin>

<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>3.3.3</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
</plugin>

</plugins>
</pluginManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class TypescriptProcessor extends AbstractProcessorEx {
*/
private java.io.Writer openFile( Path file, String header ) throws IOException {

final FileObject out = super.getSourceOutputFile( Paths.get("ts"), file );
final FileObject out = super.getSourceOutputFile( Paths.get("j2ts"), file );

info( "output file [%s]", out.getName() );

Expand Down
3 changes: 2 additions & 1 deletion samples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
.apt_generated/
.apt_generated_tests/
.cache/
.cache/
ts/j2ts/
60 changes: 60 additions & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## HOW RUN SAMPLE

### install javascript packages

> npm install
### Run using: "[GraalJs](https://github.com/graalvm/graaljs)"

**Generate TypeScript stuff**

> mvn -f graaljs-pom.xml clean package
This task will generate `jdk8.d.ts` and `jdk8-types.ts` into folder `ts/j2ts`

**Compile typescript**

> npm run build:main
This task use [parcel](https://parceljs.org/) to bundle all modules in a single javascript file in `target/js/main.js`

**Run sample**

> mvn -f graaljs-pom.xml exec:exec
### Run using: "[Nashorn](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html)"

**Generate TypeScript stuff**

> mvn clean package
This task will generate `jdk8.d.ts` and `jdk8-types.ts` into folder `ts/j2ts`

**Compile typescript**

> npm run build:main
This task use [parcel](https://parceljs.org/) to bundle all modules in a single javascript file in `target/js/main.js`

**Run sample**

> mvn exec:exec@jsrun

### Run using: "[Rhino](https://github.com/mozilla/rhino)"

**Generate TypeScript stuff**

> mvn -P rhino clean package
This task will generate `jdk8.d.ts` and `jdk8-types.ts` into folder `ts/j2ts`

**Compile typescript**

> npm run build:main
This task use [parcel](https://parceljs.org/) to bundle all modules in a single javascript file in `target/js/main.js`

**Run sample**

> mvn exec:exec
Loading

0 comments on commit 0f6da11

Please sign in to comment.