Skip to content

Commit

Permalink
JDK 11: a few Makefile changes related to building with JDK 11.
Browse files Browse the repository at this point in the history
+ Add flags for transpiling jsr305 and guava.
+ Add flags for testing cycle finder.
+ Remove flags not needed in jre_emul/Makefile and jre_emul/test.mk.

	Change on 2019/03/05 by antoniocortes <antoniocortes@google.com>

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=236875853
  • Loading branch information
antonio-cortes-perez authored and tomball committed Mar 9, 2019
1 parent 3722d8c commit 33cb44e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cycle_finder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RESOURCES = \
com/google/devtools/j2objc/JRE.mappings \
com/google/devtools/j2objc/reserved_names.txt

DIST_DEPS = $(JSR305_JAR) j2objc_annotations.jar
DIST_DEPS = $(JSR305_JAR) j2objc_annotations.jar jre_emul.jar
INTERNAL_DEPS = $(GUAVA_JAR) $(PROCYON_JARS) $(SCENELIB_JAR)
ifdef JAVA_8
INTERNAL_DEPS += $(JAVAC_JAR)
Expand Down
5 changes: 5 additions & 0 deletions guava/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ CLASSPATH = $(subst $(eval) ,:,$(strip $(CLASSPATH_LIST)))
TRANSLATE_JAVA_FULL = $(JAVA_SOURCES)
TRANSLATE_JAVA_RELATIVE = $(JAVA_SOURCES:$(JAVA_SRC_DIR)/%=%)
TRANSLATE_ARGS = -classpath $(CLASSPATH) -encoding UTF-8
ifndef JAVA_8
TRANSLATE_ARGS += \
--patch-module java.base=$(DIST_JAR_DIR)/$(JSR305_JAR) \
--add-reads java.base=ALL-UNNAMED
endif
include $(J2OBJC_ROOT)/make/translate.mk

J2OBJCC := $(ARCH_BIN_DIR)/j2objcc -c -I$(GEN_OBJC_DIR) $(CC_WARNINGS)
Expand Down
2 changes: 1 addition & 1 deletion jre_emul/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TRANSLATE_ARGS = -sourcepath $(JRE_SRC) \
$(J2OBJC_DEBUGFLAGS) -encoding UTF-8 --doc-comments -Xtranslate-bootclasspath \
--nullability -Xexternal-annotation-file $(ANDROID_ANNOTATIONS)
ifndef JAVA_8
TRANSLATE_ARGS += --system $(EMULATION_MODULE_DIST) \
TRANSLATE_ARGS += \
--patch-module java.base=$(JRE_SRC) --add-reads java.base=ALL-UNNAMED
endif
ifdef J2OBJC_JRE_REFLECTION
Expand Down
2 changes: 1 addition & 1 deletion jre_emul/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ TRANSLATE_ARGS = -classpath $(JUNIT_DIST_JAR):$(JUNIT_DATAPROVIDER_DIST_JAR) \
-Werror -sourcepath $(TEST_SRC):$(GEN_JAVA_DIR) \
-encoding UTF-8 --prefixes Tests/resources/prefixes.properties
ifndef JAVA_8
TRANSLATE_ARGS += --system $(EMULATION_MODULE_DIST) \
TRANSLATE_ARGS += \
--patch-module java.base=$(TEST_SRC):$(GEN_JAVA_DIR) \
--add-reads java.base=ALL-UNNAMED
endif
Expand Down
6 changes: 5 additions & 1 deletion jsr305/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ include ../make/create_jar.mk

TRANSLATE_JAVA_FULL = $(JAVA_SOURCES:%=$(JAVA_SRC_DIR)/%)
TRANSLATE_JAVA_RELATIVE = $(JAVA_SOURCES)
# Batch translate is turned off due to an open JDT bug.
TRANSLATE_ARGS = -sourcepath $(JAVA_SRC_DIR)
ifndef JAVA_8
TRANSLATE_ARGS += \
--patch-module java.base=$(JAVA_SRC_DIR) \
--add-reads java.base=ALL-UNNAMED
endif
include ../make/translate.mk

ARCH_HEADERS = $(TRANSLATE_HEADERS:$(GEN_OBJC_DIR)/%=$(ARCH_INCLUDE_DIR)/%)
Expand Down
8 changes: 0 additions & 8 deletions translator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,9 @@ clean:
@rm -rf $(BUILD_DIR) $(J2OBJC_JAR_DIST) $(J2OBJC_SH_DIST)

test: compile-tests copy-test-resources
ifdef JAVA_8
$(JAVA) -classpath $(TEST_CLASSPATH) -Xss4m -XX:+UseParallelGC \
-Xbootclasspath/a:$(TEST_BOOT_CLASSPATH) \
-ea junit.textui.TestRunner com.google.devtools.j2objc.SmallTests
else
# TODO(user): move bootclasspath to --system=bootclasspath
# once jre_emul.jar is modularized.
$(JAVA) -classpath $(TEST_CLASSPATH):$(TEST_BOOT_CLASSPATH) \
-Xss4m -XX:+UseParallelGC \
-ea junit.textui.TestRunner com.google.devtools.j2objc.SmallTests
endif

compile-tests: $(J2OBJC_JAR)
@mkdir -p $(TEST_DIR)
Expand Down

0 comments on commit 33cb44e

Please sign in to comment.