Skip to content

Commit

Permalink
promote release
Browse files Browse the repository at this point in the history
update doc
  • Loading branch information
bsorrentino committed Feb 12, 2019
1 parent b8b3cf2 commit 02af989
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 36 deletions.
35 changes: 32 additions & 3 deletions 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** (ie [Nashorn](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html)) using [Typescript](https://www.typescriptlang.org/)
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/)

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 Expand Up @@ -40,7 +40,7 @@ To give an idea about **how to work** there is a demo available online [here](ht
## Description

Basic idea is to develop a Project by mixing Java & Javascript code or even all in Javascript relying on the [Nashorn Javascript engine](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html) embedded in JDK from Java8. This powerful engine enable Javascript language in JVM and allows to access to every java class either from JDK and external JAR(s) in a pretty straightforward way.
Basic idea is to develop a Project by mixing Java & Javascript code (or completely in Javascript) relying on the [Nashorn Javascript engine](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html) or [Rhino javascript engine](https://github.com/mozilla/rhino). This powerful engines enable Javascript language in JVM and they allow to access to every java class present in classpath in a pretty straightforward way.
That's cool, the Javascript is very easy to learn, but the question are :
1. _Is it possible develop a complete and well structured Javascript application ?_
1. _Developing in Javascript on JVM is as productive as programming in Java ?_
Expand Down Expand Up @@ -115,6 +115,8 @@ package org.mypackage;
```
### Add the Annotation Processor Plugin

**Standard [Nashorn](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html) compatibility**

```xml
<plugin>
<groupId>org.bsc.maven</groupId>
Expand All @@ -139,6 +141,33 @@ package org.mypackage;

```

**Enforce [Rhino](https://github.com/mozilla/rhino) compatibility**

```xml
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>3.3.3</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<options>
<ts.outfile>name</ts.outfile><!-- name of generated file -->
<compatibility>rhino</compatibility>
</options>
</configuration>
</execution>
</executions>
</plugin>
```


### Use Maven Archetype

The easier way to start your **Typescript on JVM** project is using the provided maven archetype
Expand All @@ -149,5 +178,5 @@ The easier way to start your **Typescript on JVM** project is using the provided
>mvn archetype:generate \
>-DarchetypeGroupId=org.bsc.processor \
>-DarchetypeArtifactId=java2ts-processor-archetype \
>-DarchetypeVersion=1.0.0
>-DarchetypeVersion=1.1.0
>```
2 changes: 1 addition & 1 deletion archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.bsc.processor</groupId>
<artifactId>java2ts-processor-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.0</version>
</parent>
<artifactId>java2ts-processor-archetype</artifactId>
<name>java2ts-processor::archetype - ${project.version}</name>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.bsc.processor</groupId>
<artifactId>java2ts-processor-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.0</version>
</parent>
<artifactId>java2ts-processor-core</artifactId>
<name>java2ts-processor::core - ${project.version}</name>
Expand Down
18 changes: 12 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.bsc.processor</groupId>
<artifactId>java2ts-processor-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.0</version>
<packaging>pom</packaging>

<name>java2ts-processor::parent - ${project.version}</name>
Expand Down Expand Up @@ -40,7 +40,7 @@
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

<developers>
<developer>
<email>bartolomeo.sorrentino@gmail.com</email>
Expand All @@ -67,9 +67,7 @@
<modules>
<module>processor</module>
<module>archetype</module>
<!--
<module>sample</module>
-->
<module>core</module>
</modules>
<dependencyManagement>
Expand Down Expand Up @@ -180,12 +178,14 @@
</plugin>
<!--
====================================================================================
# https://github.com/keybase/keybase-issues/issues/2798
export GPG_TTY=$(tty)
mvn -Prelease source:jar javadoc:jar deploy -Dgpg.passphrase=thephrase
====================================================================================
-->
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.3</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -195,6 +195,12 @@
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
Expand All @@ -211,5 +217,5 @@
</build>
</profile>
</profiles>

</project>
2 changes: 1 addition & 1 deletion processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.bsc.processor</groupId>
<artifactId>java2ts-processor-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.0</version>
</parent>

<build>
Expand Down
48 changes: 24 additions & 24 deletions sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
<parent>
<groupId>org.bsc.processor</groupId>
<artifactId>java2ts-processor-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.0</version>
</parent>

<build>
<pluginManagement>

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


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

</plugins>

</pluginManagement>

<finalName>sample</finalName>
Expand Down Expand Up @@ -107,17 +107,17 @@


</dependencies>

<profiles>
<profile>
<id>nashorn</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>

<dependencies>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -161,28 +161,28 @@
</plugins>
</build>
</profile>

<profile>
<id>rhino</id>

<dependencies>

<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>1.7.10</version>
</dependency>

<dependency>
<groupId>org.bsc</groupId>
<artifactId>jvm-npm-rhino</artifactId>
<version>1.1.0</version>
</dependency>

</dependencies>

<build>

<plugins>
<plugin>
<groupId>org.bsc.maven</groupId>
Expand All @@ -204,15 +204,15 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>jjs</id>
<configuration>
<executable>java</executable>
<!--
<!--
<mainClass>org.bsc.java2ts.JSRun</mainClass>
-->
<arguments>
Expand All @@ -221,16 +221,16 @@
<!--argument>org.mozilla.javascript.tools.shell.Main</argument-->
<argument>org.bsc.java2ts.JSRun$Rhino</argument>
<argument>app.rhino.js</argument>

</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugin>

</plugins>
</build>
</profile>

</profiles>
</project>

0 comments on commit 02af989

Please sign in to comment.