Skip to content

Commit

Permalink
Fix the build (#569)
Browse files Browse the repository at this point in the history
* Fix #570. Build broken on Cirrus by upgrade to Bazel v1.0
  * The `single_file` attribute has been replaced by `allow_single_file`.
    Use **bazel_rules** v4 which fixed this. jflex-de/bazel_rules#13
  * add `--incompatible_depset_union=false`
    bazel_pandoc ProdriveTechnologies/bazel-pandoc#6 needs to update for incompatible_depset_union bazelbuild/bazel#5817
  * Use ProdriveTechnologies/bazel-latex#26 because `run_lualatex.py` is not executable
  * In deps, use `https` rather than `http`
* Fix build broken on Travis due to upgrade to Xenial
  * Use openjdk11 because whatever I ask for, that's what I get.
  * Upgrade maven-compiler-plugin to 3.8.0 to fix _class file has wrong version 55.0, should be 53.0_
  * Fix maven-compiler-plugin config for ErrorProne
  * Fix config of maven-javadoc-plugin for newer JDK. https://bugs.openjdk.java.net/browse/JDK-8212233
  * In aggregated sources, update to JDK8 because Xenial doesn't support JDK7 anymore.
    Add manual dep on **javax-annotations.jar** because because JDK8 doesn't provide it anymore.
  * Remove the task that builds the docs because `\tightlist` is not known. #571
  • Loading branch information
regisd authored Nov 5, 2019
1 parent 46b00aa commit 8e95060
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 70 deletions.
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# This incompatible change was introduced in Bazel 0.26
# https://github.com/bazelbuild/bazel/issues/5817
# bazel_pandoc needs to update
# https://github.com/ProdriveTechnologies/bazel-pandoc/issues/6
build --incompatible_depset_union=false

test --test_output=errors

# http://errorprone.info/bugpatterns
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jflex/build
*.ipr
*.iws
.idea
.ijwb

# Eclipse project
.project
Expand Down
24 changes: 3 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git:
language: java

jdk:
- openjdk9
- openjdk11

matrix:
include:
Expand All @@ -35,26 +35,9 @@ matrix:
- scripts/test-regression.sh
- name: "😎 Examples (mvn, ant, make)"
script: scripts/test-examples.sh
- name: "👴 Examples (mvn, ant, make) — JDK7"
- name: "👴 Examples (mvn, ant, make) — JDK8"
script: scripts/test-examples.sh
jdk: openjdk7
- name: "📄 Documentation"
language: generic
install: true
addons:
apt:
packages:
# pandoc used for building the doc
- pandoc
- pandoc-citeproc
# texlive used for PDF output
- texlive
# texlive-latex-extra provides extra styles such as a4wide and upquote.sty
- texlive-latex-extra
# lmodern.sty
- lmodern
script:
- cd docs; make; cd ..
jdk: openjdk8

# Empty the previously built artifacts
# They cannot be deleted in the before_cache phase,
Expand Down Expand Up @@ -111,4 +94,3 @@ deploy:
condition:
- $PUBLISH_SOURCES
script: scripts/deploy-aggregated-sources.sh

20 changes: 14 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
git_repository(
name = "jflex_rules",
remote = "https://github.com/jflex-de/bazel_rules.git",
tag = "v3",
tag = "v4",
)

load("@jflex_rules//jflex:deps.bzl", "jflex_deps")
Expand All @@ -28,12 +28,20 @@ load("@bazel_pandoc//:repositories.bzl", "pandoc_repositories")
pandoc_repositories()

# latex rule to build PDF from tex files

http_archive(
#
#http_archive(
# name = "bazel_latex",
# sha256 = "b4dd9ae76c570b328be30cdc5ea7045a61ecd55e4e6e2e433fb3bb959be2a44b",
# strip_prefix = "bazel-latex-0.16",
# url = "https://github.com/ProdriveTechnologies/bazel-latex/archive/v0.16.tar.gz",
#)
#
# This is a proposed fix for `OSError: [Errno 13] Permission denied: run_lualatex.py`
# https://github.com/ProdriveTechnologies/bazel-latex/issues/23
git_repository(
name = "bazel_latex",
sha256 = "b4dd9ae76c570b328be30cdc5ea7045a61ecd55e4e6e2e433fb3bb959be2a44b",
strip_prefix = "bazel-latex-0.16",
url = "https://github.com/ProdriveTechnologies/bazel-latex/archive/v0.16.tar.gz",
commit = "1ba1fb087b8526cfe28c7c31471f412107ee6f09",
remote = "https://github.com/Selmaai/bazel-latex.git",
)

load("@bazel_latex//:repositories.bzl", "latex_repositories")
Expand Down
12 changes: 0 additions & 12 deletions cup-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,4 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion cup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down
51 changes: 25 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down Expand Up @@ -253,7 +253,11 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<version>3.1.1</version>
<configuration>
<!-- https://bugs.openjdk.java.net/browse/JDK-8212233 -->
<source>8</source>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -282,15 +286,15 @@
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.6</version>
<version>3.8.2</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<version>3.0.0-M3</version>
</plugin>
</plugins>
</pluginManagement>
Expand All @@ -300,8 +304,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -444,35 +448,30 @@
<profile>
<id>error-prone</id>
<activation>
<jdk>[1.8,)</jdk>
<jdk>[1.9,)</jdk>
<property>
<name>DISABLED</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<source>8</source>
<target>8</target>
<compilerArgs>
<arg>-Xep:FallThrough:WARN</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne -Xep:FallThrough:WARN</arg>
</compilerArgs>
<source>1.7</source>
<target>1.7</target>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.3.3</version>
</path>
</annotationProcessorPaths>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8</version>
</dependency>
<!-- override plexus-compiler-javac-errorprone's dependency on
Error Prone with the latest version -->
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down
1 change: 1 addition & 0 deletions scripts/compile-aggregated-java-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ mvnget() {

mvnget org/apache/ant/ant/1.7.0/ant-1.7.0.jar
mvnget com/google/auto/value/auto-value-annotations/1.6.2/auto-value-annotations-1.6.2.jar
mvnget javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar

CP=${CP##:} # Remove leading ':'
javac -cp "$CP" $(find . -name '*.java')
8 changes: 4 additions & 4 deletions third_party/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ def third_party_deps():
native.maven_jar(
name = "com_google_auto_value_auto_value",
artifact = "com.google.auto.value:auto-value:jar:1.4.1",
repository = "http://jcenter.bintray.com/",
repository = "https://jcenter.bintray.com/",
)
native.maven_jar(
name = "com_google_guava_guava",
artifact = "com.google.guava:guava:jar:26.0-jre",
repository = "http://jcenter.bintray.com/",
repository = "https://jcenter.bintray.com/",
)
native.maven_jar(
name = "com_google_truth_truth",
artifact = "com.google.truth:truth:0.36",
repository = "http://jcenter.bintray.com/",
repository = "https://jcenter.bintray.com/",
)
native.maven_jar(
name = "junit_junit",
artifact = "junit:junit:jar:4.12",
repository = "http://jcenter.bintray.com/",
repository = "https://jcenter.bintray.com/",
)

0 comments on commit 8e95060

Please sign in to comment.