JDK 11: compiling translator without -source 1.8 -target 1.8.
Change on 2019/01/29 by antoniocortes
@@ -317,13 +317,29 @@ default: $(J2OBJC_JAR)
$(J2OBJC_JAR): $(MANIFEST) $(RESOURCE_FILES) $(JAVA_SOURCES_FULL) \
| $(BUILD_DIR) java_deps_dist annotations_dist
@echo building j2objc jar
+ifdef JAVA_8
@$(JAVAC) -Xlint:unchecked -sourcepath $(SOURCEPATH) -classpath $(CLASSPATH) \
-d $(CLASS_DIR) -encoding UTF-8 -source 1.8 -target 1.8 -nowarn \
$(JAVA_SOURCES_FULL)
+else
+ @$(JAVAC) -Xlint:unchecked -sourcepath $(SOURCEPATH) -classpath $(CLASSPATH) \
+ -d $(CLASS_DIR) -encoding UTF-8 -nowarn \
+ --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
+ --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
+ --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
+ --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
+ --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
+ $(JAVA_SOURCES_FULL)
+endif
@for lib in $(JAR_DEPS_DIST); do unzip -oq $$lib -d $(CLASS_DIR); done
@$(PRUNE_CMD)
+ifdef JAVA_8
@jar cfm $@-combined $(MANIFEST) -C $(CLASS_DIR) .
@$(JAVA) -jar $(JAVA_DEPS_JAR_DIR)/$(JARJAR_JAR) process jarjar.rules $@-combined $@
+else
+ # TODO(user): update jarjar to work with Java 11 bytecode.
+ @jar cfm $@ $(MANIFEST) -C $(CLASS_DIR) .
+endif
# Format manifest classpath with each jar on a separate line, to avoid
# maximum line length of 72 bytes in UTF-8 encoding.
