Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-TypeGraph Visitor for incremental builds #12

Open
wants to merge 50 commits into
base: rebased_master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
edf3997
Allow output to be generated in sources that don't yet exist
niloc132 Nov 12, 2017
0d73b8f
big squish, from various work on the pom:
Oct 7, 2017
cf58530
Updated to eclipse version that the bazel project specifies, by inclu…
niloc132 Feb 15, 2018
a36bd66
Amended new jdt deploy code to pick jars other than bazel "ijar" so w…
niloc132 Feb 19, 2018
59fdfa2
make the bazel bin a variable so jenkins can redefine it
niloc132 Feb 20, 2018
6332298
Change the path to eclipse external jars, in light of changes in the …
niloc132 Nov 14, 2018
84b95fc
make everything public, allow other tooling to be built
niloc132 Jun 27, 2018
034bd6f
Make necessary factory methods accessible
niloc132 Nov 15, 2018
d153fd3
Add helpful method to allow built options to be copied into a new bui…
niloc132 Nov 15, 2018
05010cc
Add new project (and generated jar), revisit dependencies and fix con…
niloc132 Nov 17, 2018
3ba2fec
Stitch together enough to get some junit artifacts built for testing …
niloc132 Jun 21, 2018
aa1d149
Include enough of closure to try running tests
niloc132 Jun 27, 2018
21f2ca7
js deps checkpoint
niloc132 Jun 28, 2018
3a5c643
Allow distribution of GWTTestCase, and stub in support for async tests
niloc132 Jun 28, 2018
22a0ef9
Fix generated JSON for tests, and avoid .testsuite->.js rename step
niloc132 Jun 28, 2018
510dddd
test closure deps
niloc132 Jun 28, 2018
af23559
Fix jre artifact path and add the source jar
niloc132 Nov 23, 2018
04707a6
Stop shipping a copy of the real junit, and put generated js in the s…
niloc132 Nov 25, 2018
768d51b
Add a parent pom reference (not needed with some mvn versions?)
niloc132 Dec 8, 2018
7ac8323
Update to latest guava, and clean up some excludes to avoid the incon…
niloc132 Feb 18, 2019
52afbbc
Encforce that there are no conflicts in various poms, and correct a f…
niloc132 Feb 19, 2019
6a28aeb
Added the new jar created as part of the j2cl build, bootclasspath fo…
niloc132 Mar 12, 2019
2036ed6
Fixed a version to be something that can actually be found in maven c…
niloc132 Mar 12, 2019
bda0ef5
Better shot at building stand-alone junit processor jar
niloc132 May 19, 2019
2d27c53
Create new maven modules for new frontend jars, and one just for the …
niloc132 May 24, 2019
0f03c8e
Bumped to 0.3 for breaking upstream api changes
niloc132 May 25, 2019
90983e2
Make it possible to build the junit processor from an empty cache
niloc132 May 25, 2019
3b29930
Added new JS dependencies to use closure tests
niloc132 May 25, 2019
86db68e
Enable the j2cl test processor to work on more than one test in a round
niloc132 May 30, 2019
f5f8296
adding circleci configuration
jhickman Sep 13, 2019
0fd159f
Update poms to reflect recent structure and code changes
niloc132 Oct 17, 2019
8437a0e
At some point jre.js and other stuff got published in jre.js.zip, rem…
niloc132 Nov 7, 2019
0c8d154
Increment version number to avoid incompatibility
niloc132 Nov 7, 2019
f3e5a22
Increment version to reflect breaking api change
niloc132 Jan 30, 2020
79cbd28
Revert the "avoid .testsuite->.js rename step" change so we can use s…
niloc132 Feb 13, 2020
b72b294
Increment version to reflect breaking changes (upstream and changing …
niloc132 Feb 13, 2020
9c18ede
Update closure dependencies to include requirements for tests
niloc132 Feb 27, 2020
e775b77
Depend on the new testing jar "async" - not currently supporting this…
niloc132 Feb 27, 2020
9a292a8
Update closure test dependencies
niloc132 May 23, 2020
18b7239
Workaround for upstream closure-library rewriting history?!?
niloc132 May 23, 2020
9f85897
Workaround for closure closurebuilder.py, so that advanced test build…
niloc132 May 24, 2020
a2841f3
Attempt to cache some bazel specifics to speed up builds
niloc132 May 24, 2020
c8047b8
With the old class removed, expose gwtincompatiblestripper
niloc132 Jul 7, 2020
0f4dff4
Skip rebase for now so we can stay on old bazel
niloc132 Jul 7, 2020
0395fea
Switch to using deploy-keys context
niloc132 Jul 8, 2020
90953d2
rebuild maven to match current bazel dependencies
niloc132 Jan 18, 2021
073ec61
Temporarily disabled wasm in bazel since it breaks tests
niloc132 Jan 18, 2021
0edfcad
Update closure-library test dependency zip
niloc132 Jan 21, 2021
e8e6ecd
Fix protobuf dependencies in poms so libraryinfo works at runtime
niloc132 Feb 2, 2021
69c7e6d
-TypeGraph Visitor for incremental builds
mdproctor Feb 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
defaults: &defaults
docker:
- image: vertispan/openjdk:8u222-jdk-stretch

version: 2
jobs:
closure_library:
<<: *defaults
working_directory: ~/
steps:
- run:
name: create build cache key
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
name: Restoring Cache - closure-library
keys:
- v1-closure-library-{{ checksum ".circle-sha" }}
# if cache is not present load any most recent
- v1-closure-library-
- run:
name: update or clone closure-library
command: |
if [ -e closure-library ]; then
# if the cache contained it, let's just update
echo update from remote

cd closure-library
git remote update
git reset --hard origin/master
else
echo cloning repository
git clone https://github.com/google/closure-library
fi
- save_cache: # TODO this should probably be using workspace, not cache
name: Saving Cache - closure-library
key: v1-closure-library-{{ checksum ".circle-sha" }}
paths:
- ~/closure-library

build:
<<: *defaults
working_directory: ~/j2cl
steps:
- checkout
- run:
name: create build cache key
command: echo $CIRCLE_SHA1 > .circle-sha
- run:
name: environment check
command: |
java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
env MAVEN_OPTS="-XX:+PrintFlagsFinal" mvn -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
mvn -version

# - run:
# name: Rebase j2cl onto google upstream changes
# command: |
# echo rebasing onto upstream
# set +e
# git remote get-url upstream
# if [ $? != 0 ]; then
# echo adding google remote
# git remote add upstream git@github.com:google/j2cl.git
# fi
# set -e
# echo setup local git user
# git config --global user.email "sales@vertispan.com"
# git config --global user.name "Vertispan CI"
# echo git remote update
# git remote update
# #echo git checkout origin/master
# #git checkout origin/master
#
# echo starting rebase on upstream/master
# set +e
# # temp comment out the rebase to test build
# git rebase upstream/master
# exitCode=$?;
# set -e
#
# if [ $exitCode != 0 ]; then
# # not really needed
# echo rebase failure
# git rebase --abort
# exit $exitCode;
# fi

- restore_cache: # TODO this should probably be using workspace, not cache
name: Restoring Cache - closure-library
keys:
- v1-closure-library-{{ checksum ".circle-sha" }}
# if cache is not present load any most recent - shouldn't happen by this point of build
- v1-closure-library-

- restore_cache:
name: Restoring cache - bazel repository
key: v1-bazel-{{ checksum ".bazelversion" }}-{{ checksum "WORKSPACE" }}-{{ checksum "build_defs/repository.bzl" }}
paths:
- ~/bazel_repository_cache
- run:
name: Initialize bazel options
command: |
# limit the bazel jobs due to failures in circleci
echo "build --jobs=1" >> .bazelrc
echo "build --local_ram_resources=512" >> .bazelrc
echo "--host_jvm_args=-Xmx512m" >> .bazelrc
# ask bazel to put its downloaded resources in a directory we can cache
echo "build --repository_cache=~/bazel_repository_cache" >> .bazelrc
# verify that all dependencies are up to date
bazel sync
- run:
name: Run bazel build
command: |
cd maven
# try up to 4 times, bazel requests more resources than circleci will give it
./build.sh || ./build.sh || ./build.sh || ./build.sh
- save_cache:
name: Save Cache - bazel repository
key: v1-bazel-{{ checksum ".bazelversion" }}-{{ checksum "WORKSPACE" }}-{{ checksum "build_defs/repository.bzl" }}
paths:
- ~/bazel_repository_cache
- restore_cache:
name: Restoring Cache - m2 repository
keys:
- v1-dependencies-{{ checksum "maven/pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Deploy jars
command: |
cd maven
mvn deploy -s ../.circleci/settings.xml -Dartifactory.username=$ARTIFACTORY_USER -Dartifactory.password=$ARTIFACTORY_APIKEY
- save_cache:
name: Save Cache - m2 repository
paths:
- ~/.m2/repository
key: v1-dependencies-{{ checksum "maven/pom.xml" }}


workflows:
version: 2
ci_build:
jobs:
- closure_library
- build:
requires:
- closure_library
context: deploy-keys

13 changes: 13 additions & 0 deletions .circleci/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<id>vertispan-snapshots</id>
<username>${artifactory.username}</username>
<password>${artifactory.password}</password>
</server>
</servers>
</settings>

8 changes: 4 additions & 4 deletions build_defs/internal_do_not_use/j2cl_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def j2cl_library(
_to_j2wasm_targets("exports", j2wasm_args)
j2wasm_args["tags"] = (j2wasm_args.get("tags") or []) + ["manual", "notap"]

j2wasm_library(
name = j2wasm_library_name,
**j2wasm_args
)
# j2wasm_library(
# name = j2wasm_library_name,
# **j2wasm_args
# )

_ALLOWED_ATTRS = [key for key in J2WASM_LIB_ATTRS] + ["tags", "visibility"]

Expand Down
2 changes: 1 addition & 1 deletion build_defs/internal_do_not_use/j2cl_workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ filegroup(
actual = "@com_google_guava",
)

# Required by protobuf_java_util
# Required by protobuf_java_util, also needed by generator
native.bind(
name = "gson",
actual = "@com_google_code_gson",
Expand Down
11 changes: 11 additions & 0 deletions jre/javatests/com/google/gwt/junit/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
licenses([
"notice", # Apache
])

load("//build_defs:rules.bzl", "j2cl_library")

j2cl_library(
name = "gwttestcase_emul",
srcs = glob(["**/*.java"]),
deps = ["//junit/emul/java:junit_emul"]
)
7 changes: 7 additions & 0 deletions jre/javatests/com/google/gwt/junit/client/GWTTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ protected final void setUp() throws Exception {
protected final void tearDown() throws Exception {
gwtTearDown();
}

protected final void delayTestFinish(int timeoutMillis) {

}

protected final void finishTest() {
}
}
5 changes: 4 additions & 1 deletion junit/emul/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ j2cl_library(
javacopts = [
"-Xep:DoNotCall:OFF",
],
visibility = ["//:__pkg__"],
visibility = [
"//:__pkg__",
"//jre:__subpackages__",
],
)
12 changes: 12 additions & 0 deletions junit/generator/java/com/google/j2cl/junit/apt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,16 @@ java_library(
"//third_party:jsr305_annotations",
"//third_party:junit",
],
plugins = [":autoservice_plugin"],
)


java_plugin(
name = "autoservice_plugin",
processor_class = "com.google.auto.service.processor.AutoServiceProcessor",
deps = [
"//third_party:auto_service",
"//third_party:guava",
"//third_party:auto_common",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ public Set<? extends Class<? extends Annotation>> annotations() {
@Override
public Set<Element> process(
SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
Element value = Iterables.getOnlyElement(elementsByAnnotation.get(J2clTestInput.class));
String className =
MoreApt.getClassNameFromAnnotation(value, J2clTestInput.class, "value").get();
handleClass(className);
elementsByAnnotation.get(J2clTestInput.class).forEach(value -> {
String className =
MoreApt.getClassNameFromAnnotation(value, J2clTestInput.class, "value").get();
handleClass(className);
});
return ImmutableSet.of();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private String mergeTemplate(TestClass testClass, String template) throws Except
private void writeResource(String qualifiedName, String content) throws IOException {
try (Writer writer =
filer
.createResource(StandardLocation.CLASS_OUTPUT, "", qualifiedName, new Element[0])
.createResource(StandardLocation.SOURCE_OUTPUT, "", qualifiedName, new Element[0])
.openWriter()) {
writer.write(content);
}
Expand Down
75 changes: 75 additions & 0 deletions maven/ast/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.vertispan.j2cl</groupId>
<artifactId>j2cl-parent</artifactId>
<version>0.9-SNAPSHOT</version>
</parent>
<artifactId>ast</artifactId>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>../../bazel-bin/transpiler/java/com/google/j2cl/transpiler/ast/libast.jar</file>
<type>jar</type>
</artifact>
<artifact>
<file>../../bazel-bin/transpiler/java/com/google/j2cl/transpiler/ast/libast-src.jar</file>
<type>jar</type>
<classifier>sources</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>

<dependency>
<groupId>com.vertispan.j2cl</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.vertispan.j2cl</groupId>
<artifactId>common-visitor</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Loading