Skip to content

Commit 42bc556

Browse files
committed
Merge branch 'release/0.6.0'
2 parents a257665 + 383fbf3 commit 42bc556

File tree

946 files changed

+160800
-51016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

946 files changed

+160800
-51016
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88

99
## [Unreleased]
10+
11+
## [0.5.6] - 2018-10-07
1012
- Added a package command to package either fat jar or a JVMCI fat jar.
1113
- Fix issue preventing GraalJS running on OpenJ9
1214
- Allow specifying absolute path as start module
@@ -18,6 +20,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1820
- Decoupled Codec from the engine (avoids calls on the wrong context)
1921
- Several clean ups
2022

23+
## [0.5.5] - Demo release
24+
- Small fixes in order to get demos running
25+
2126
## [0.5.4] - 2018-09-17
2227
- Bump `pg-reactive-client` to 0.10.3
2328
- Fix `parsePaths` to properly convert slashes on windows.

codegen/pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
6+
<parent>
7+
<groupId>io.reactiverse</groupId>
8+
<artifactId>es4x-parent</artifactId>
9+
<version>0.6.0</version>
10+
<relativePath>..</relativePath>
11+
</parent>
12+
13+
<modelVersion>4.0.0</modelVersion>
14+
15+
<artifactId>es4x-codegen</artifactId>
16+
<version>0.6.0</version>
17+
18+
<properties>
19+
</properties>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>io.vertx</groupId>
24+
<artifactId>vertx-core</artifactId>
25+
<version>${vertx.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>io.vertx</groupId>
29+
<artifactId>vertx-codegen</artifactId>
30+
<version>${vertx.version}</version>
31+
</dependency>
32+
</dependencies>
33+
34+
<build>
35+
<plugins>
36+
<plugin>
37+
<groupId>org.apache.maven.plugins</groupId>
38+
<artifactId>maven-compiler-plugin</artifactId>
39+
</plugin>
40+
<plugin>
41+
<groupId>com.amashchenko.maven.plugin</groupId>
42+
<artifactId>gitflow-maven-plugin</artifactId>
43+
</plugin>
44+
</plugins>
45+
</build>
46+
47+
</project>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2018 Paulo Lopes.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License v1.0
6+
* and Apache License v2.0 which accompanies this distribution.
7+
*
8+
* The Eclipse Public License is available at
9+
* http://www.eclipse.org/legal/epl-v10.html
10+
*
11+
* The Apache License v2.0 is available at
12+
* http://www.opensource.org/licenses/apache2.0.php
13+
*
14+
* You may elect to redistribute this code under either of these licenses.
15+
*/
16+
package io.reactiverse.es4x.codegen;
17+
18+
import io.reactiverse.es4x.codegen.generator.*;
19+
import io.vertx.codegen.Generator;
20+
import io.vertx.codegen.GeneratorLoader;
21+
22+
import javax.annotation.processing.ProcessingEnvironment;
23+
import java.util.LinkedList;
24+
import java.util.List;
25+
import java.util.stream.Stream;
26+
27+
public class ES4XGeneratorLoader implements GeneratorLoader {
28+
@Override
29+
public Stream<Generator<?>> loadGenerators(ProcessingEnvironment processingEnv) {
30+
31+
final List<Generator<?>> generators = new LinkedList<>();
32+
33+
generators.add(new IndexJS());
34+
generators.add(new IndexDTS());
35+
generators.add(new OptionsJS());
36+
generators.add(new OptionsDTS());
37+
generators.add(new EnumJS());
38+
generators.add(new EnumDTS());
39+
generators.add(new ReadmeMD());
40+
generators.add(new PackageJSON());
41+
42+
return generators.stream();
43+
44+
}
45+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2018 Paulo Lopes.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License v1.0
6+
* and Apache License v2.0 which accompanies this distribution.
7+
*
8+
* The Eclipse Public License is available at
9+
* http://www.eclipse.org/legal/epl-v10.html
10+
*
11+
* The Apache License v2.0 is available at
12+
* http://www.opensource.org/licenses/apache2.0.php
13+
*
14+
* You may elect to redistribute this code under either of these licenses.
15+
*/
16+
package io.reactiverse.es4x.codegen.generator;
17+
18+
import io.vertx.codegen.EnumModel;
19+
import io.vertx.codegen.EnumValueInfo;
20+
import io.vertx.codegen.Generator;
21+
22+
import java.io.PrintWriter;
23+
import java.io.StringWriter;
24+
import java.util.HashSet;
25+
import java.util.Map;
26+
27+
public class EnumDTS extends Generator<EnumModel> {
28+
29+
public EnumDTS() {
30+
incremental = true;
31+
32+
kinds = new HashSet<>();
33+
kinds.add("enum");
34+
35+
name = "es4x-generator (enum.d.ts)";
36+
}
37+
38+
@Override
39+
public String filename(EnumModel model) {
40+
return "npm/enums.d.ts";
41+
}
42+
43+
@Override
44+
public String render(EnumModel model, int index, int size, Map<String, Object> session) {
45+
46+
StringWriter sw = new StringWriter();
47+
PrintWriter writer = new PrintWriter(sw);
48+
49+
if (index == 0) {
50+
Util.generateLicense(writer);
51+
} else {
52+
writer.print("\n");
53+
}
54+
55+
writer.printf("export enum %s {\n", model.getType().getRaw().getSimpleName());
56+
for (int i = 0; i < model.getValues().size(); i++) {
57+
EnumValueInfo value = model.getValues().get(i);
58+
writer.printf(" %s", value.getIdentifier());
59+
if (i != model.getValues().size() - 1) {
60+
writer.print(",");
61+
}
62+
writer.print("\n");
63+
}
64+
writer.print("}\n");
65+
66+
return sw.toString();
67+
}
68+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright 2018 Paulo Lopes.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License v1.0
6+
* and Apache License v2.0 which accompanies this distribution.
7+
*
8+
* The Eclipse Public License is available at
9+
* http://www.eclipse.org/legal/epl-v10.html
10+
*
11+
* The Apache License v2.0 is available at
12+
* http://www.opensource.org/licenses/apache2.0.php
13+
*
14+
* You may elect to redistribute this code under either of these licenses.
15+
*/
16+
package io.reactiverse.es4x.codegen.generator;
17+
18+
import io.vertx.codegen.Generator;
19+
import io.vertx.codegen.EnumModel;
20+
21+
import java.io.PrintWriter;
22+
import java.io.StringWriter;
23+
import java.util.HashSet;
24+
import java.util.Map;
25+
26+
import static io.reactiverse.es4x.codegen.generator.Util.*;
27+
28+
public class EnumJS extends Generator<EnumModel> {
29+
30+
public EnumJS() {
31+
incremental = true;
32+
33+
kinds = new HashSet<>();
34+
kinds.add("enum");
35+
36+
name = "es4x-generator (enum.js)";
37+
}
38+
39+
@Override
40+
public String filename(EnumModel model) {
41+
return "npm/enums.js";
42+
}
43+
44+
@Override
45+
public String render(EnumModel model, int index, int size, Map<String, Object> session) {
46+
47+
StringWriter sw = new StringWriter();
48+
PrintWriter writer = new PrintWriter(sw);
49+
50+
if (index == 0) {
51+
Util.generateLicense(writer);
52+
writer.printf("/// <reference types=\"%s/enums\" />\n", getNPMScope(model.getType().getRaw().getModule()));
53+
writer.print("module.exports = {\n");
54+
}
55+
56+
writer.printf(" %s: Java.type('%s')", model.getType().getRaw().getSimpleName(), model.getType().getName());
57+
58+
if (index != size - 1) {
59+
writer.print(',');
60+
}
61+
62+
writer.print('\n');
63+
64+
if (index == size - 1) {
65+
writer.print("};\n");
66+
}
67+
68+
return sw.toString();
69+
}
70+
}

0 commit comments

Comments
 (0)