Skip to content

Commit

Permalink
Some changes added to compile and run with Java 6 and Java 7.
Browse files Browse the repository at this point in the history
  - correction of errors with Javac 6:
    - target 1.5 and source empty.
  - correction of errors with Javadoc 7:
    - strange behavior when duplicate classes are given.

Change-Id: Ib814ede143f7799ef18e0fb1b733547519b8b0e5
  • Loading branch information
brachior authored and Gerrit Code Review committed Jan 11, 2013
1 parent 5584637 commit eded398
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions core/combo/javac.mk
Expand Up @@ -10,9 +10,9 @@
# Whatever compiler is on this system.
ifeq ($(BUILD_OS), windows)
COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
-target 1.5 -Xmaxerrs 9999999
-target 1.5 -source 1.5 -Xmaxerrs 9999999
else
COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -Xmaxerrs 9999999
COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
endif

# Eclipse.
Expand All @@ -26,7 +26,7 @@ endif
ifeq ($(CUSTOM_JAVA_COMPILER), openjdk)
# We set the VM options (like -Xmx) in the javac script.
COMMON_JAVAC := prebuilt/common/openjdk/bin/javac -target 1.5 \
-Xmaxerrs 9999999
-source 1.5 -Xmaxerrs 9999999
$(info CUSTOM_JAVA_COMPILER=openjdk)
endif

Expand Down
6 changes: 6 additions & 0 deletions core/droiddoc.mk
Expand Up @@ -159,6 +159,9 @@ $(full_target): $(full_src_files) $(droiddoc_templates) $(droiddoc) $(html_dir_f
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(hide) ( \
head -1 $(PRIVATE_SRC_LIST_FILE) | tr " " "\n" | sort | uniq | tr "\n" " " > $(PRIVATE_SRC_LIST_FILE)_temp; \
cat $(PRIVATE_SRC_LIST_FILE) | sed '1 d' >> $(PRIVATE_SRC_LIST_FILE)_temp; \
mv $(PRIVATE_SRC_LIST_FILE)_temp $(PRIVATE_SRC_LIST_FILE); \
javadoc \
\@$(PRIVATE_SRC_LIST_FILE) \
-J-Xmx1280m \
Expand Down Expand Up @@ -191,6 +194,9 @@ $(full_target): $(full_src_files) $(full_java_lib_deps)
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(hide) ( \
head -1 $(PRIVATE_SRC_LIST_FILE) | tr " " "\n" | sort | uniq | tr "\n" " " > $(PRIVATE_SRC_LIST_FILE)_temp; \
cat $(PRIVATE_SRC_LIST_FILE) | sed '1 d' >> $(PRIVATE_SRC_LIST_FILE)_temp; \
mv $(PRIVATE_SRC_LIST_FILE)_temp $(PRIVATE_SRC_LIST_FILE); \
javadoc \
$(PRIVATE_DROIDDOC_OPTIONS) \
\@$(PRIVATE_SRC_LIST_FILE) \
Expand Down
8 changes: 4 additions & 4 deletions core/main.mk
Expand Up @@ -122,7 +122,7 @@ endif


# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '^java .*[ "]1\.6[\. "$$]')
java_version := $(shell java -version 2>&1 | head -n 1 | grep '^java .*[ "]1\.[67][\. "$$]')
ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
java_version :=
endif
Expand All @@ -132,22 +132,22 @@ $(info You are attempting to build with an unsupported version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: Java SE 1.6.)
$(info The correct version is: Java SE 1.6 or 1.7.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
$(info ************************************************************)
endif

# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.[67][\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info The correct version is: 1.6 or 1.7.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
Expand Down

0 comments on commit eded398

Please sign in to comment.