Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Sep 8, 2019
2 parents 92f05a9 + e09a452 commit 7cb4c29
Show file tree
Hide file tree
Showing 65 changed files with 16,314 additions and 495 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ 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) or [Rhino](https://github.com/mozilla/rhino) using [Typescript](https://www.typescriptlang.org/)
> [Nashorn](http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html) has been **DEPRECATED** (refer to [JEP335](http://openjdk.java.net/jeps/335) )
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 @@ -117,7 +118,7 @@ package org.mypackage;
```
### Add the Annotation Processor Plugin

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

```xml
<plugin>
Expand All @@ -143,7 +144,7 @@ package org.mypackage;

```

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

```xml
<plugin>
Expand Down
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</version>
<version>1.2.0</version>
</parent>
<artifactId>java2ts-processor-archetype</artifactId>
<name>java2ts-processor::archetype - ${project.version}</name>
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
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</version>
<version>1.2.0</version>
</parent>
<artifactId>java2ts-processor-core</artifactId>
<name>java2ts-processor::core - ${project.version}</name>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bsc/java2typescript/TSType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/**
*
* @author softphone
* @author bsorrentino
*
*/
@SuppressWarnings("serial")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/**
*
* @author softphone
* @author bsorrentino
*
*/
public class TypescriptConverter extends TypescriptConverterStatic {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
*
* @author bsorrentino
*
*/
public abstract class TypescriptConverterStatic {

static final String ENDL = ";\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

import org.bsc.java2typescript.TypescriptConverter.Compatibility;

/**
*
* @author bsorrentino
*
*/
public abstract class AbstractConverterTest {

final TypescriptConverter converter = new TypescriptConverter(Compatibility.NASHORN);
Expand Down
5 changes: 5 additions & 0 deletions core/src/test/java/org/bsc/java2typescript/ConverterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
import org.junit.Assert;
import org.junit.Test;

/**
*
* @author bsorrentino
*
*/
public class ConverterTest extends AbstractConverterTest {

@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
import org.junit.Assert;
import org.junit.Test;

/**
*
* @author bsorrentino
*
*/
public class MemeberClassTest extends AbstractConverterTest {


Expand Down
5 changes: 5 additions & 0 deletions core/src/test/java/org/bsc/java2typescript/ProcessorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
import org.junit.Assert;
import org.junit.Test;

/**
*
* @author bsorrentino
*
*/
public class ProcessorTest extends AbstractConverterTest {

@Test
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/org/bsc/java2typescript/Sample1.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.bsc.java2typescript;

/**
*
*/
import java.util.concurrent.Future;
import java.util.function.BiConsumer;
import java.util.function.BiPredicate;
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/org/bsc/java2typescript/Sample2.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package org.bsc.java2typescript;

/**
*
* @author bsorrentino
*
* @param <T>
*/
public interface Sample2<T> {

T method1();
Expand Down
5 changes: 5 additions & 0 deletions core/src/test/java/org/bsc/java2typescript/TestIssue7.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
import org.junit.Assert;
import org.junit.Test;

/**
*
* @author bsorrentino
*
*/
public class TestIssue7 extends AbstractConverterTest {

interface TestBean<K,V> {
Expand Down
93 changes: 59 additions & 34 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</version>
<version>1.2.0</version>
<packaging>pom</packaging>

<name>java2ts-processor::parent - ${project.version}</name>
Expand Down Expand Up @@ -67,7 +67,7 @@
<modules>
<module>processor</module>
<module>archetype</module>
<module>sample</module>
<module>samples</module>
<module>core</module>
</modules>
<dependencyManagement>
Expand All @@ -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
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</version>
<version>1.2.0</version>
</parent>

<build>
Expand Down
5 changes: 4 additions & 1 deletion processor/src/main/java/org/bsc/processor/Tuple2.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
package org.bsc.processor;

/**
*
* @author bsorrentino
*
* @author softphone
* @param <T0>
* @param <T1>
*/
public class Tuple2<T0,T1> {
final T0 $0;
Expand Down
6 changes: 5 additions & 1 deletion processor/src/main/java/org/bsc/processor/Tuple3.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
package org.bsc.processor;

/**
*
* @author bsorrentino
*
* @author softphone
* @param <T0>
* @param <T1>
* @param <T2>
*/
public class Tuple3<T0,T1,T2> extends Tuple2<T0,T1> {
final T2 $2;
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/**
*
* @author bsorrentino
*
*/
@Retention(RetentionPolicy.SOURCE)
@Target( {ElementType.TYPE, ElementType.PACKAGE} )
public @interface Java2TS {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
*
* @author bsorrentino
*
*/
@Retention(RetentionPolicy.SOURCE)
@Target( {ElementType.ANNOTATION_TYPE} )
public @interface Type {
Expand Down
2 changes: 0 additions & 2 deletions sample/.gitignore

This file was deleted.

Loading

0 comments on commit 7cb4c29

Please sign in to comment.