6654458: /java/devtools findbugs doesn't work on windows
authorohair
Tue, 18 Mar 2008 11:08:09 -0700
changeset 140 3d601b5affa3
parent 139 05173e59b878
child 141 dd739bd1bd2b
6654458: /java/devtools findbugs doesn't work on windows Summary: Changes to both ant and findbugs version checking. Reviewed-by: tbell
jdk/make/common/shared/Defs-utils.gmk
jdk/make/common/shared/Defs.gmk
jdk/make/common/shared/Sanity.gmk
--- a/jdk/make/common/shared/Defs-utils.gmk	Tue Mar 18 11:06:34 2008 -0700
+++ b/jdk/make/common/shared/Defs-utils.gmk	Tue Mar 18 11:08:09 2008 -0700
@@ -67,16 +67,6 @@
   UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
 endif
 
-# Utilities ant and findbugs
-ifndef ANT_HOME
-  ANT_HOME = $(JDK_DEVTOOLS_DIR)/share/ant/latest
-endif
-ANT = $(ANT_HOME)/bin/ant
-ifndef FINDBUGS_HOME
-  FINDBUGS_HOME = $(JDK_DEVTOOLS_DIR)/share/findbugs/latest
-endif
-FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
-
 # Utilities
 ADB            = $(UTILS_COMMAND_PATH)adb
 AR             = $(UTILS_CCS_BIN_PATH)ar
--- a/jdk/make/common/shared/Defs.gmk	Tue Mar 18 11:06:34 2008 -0700
+++ b/jdk/make/common/shared/Defs.gmk	Tue Mar 18 11:08:09 2008 -0700
@@ -503,6 +503,24 @@
   endif
 endif
 
+# Utilities ant and findbugs
+ifeq ($(ANT_HOME),)
+  ANT_HOME := $(call DirExists,/usr/share/ant,$(JDK_DEVTOOLS_DIR)/share/ant/latest,)
+endif
+ifeq ($(ANT_HOME),)
+  ANT = ant
+else
+  ANT = $(ANT_HOME)/bin/ant
+endif
+ifeq ($(FINDBUGS_HOME),)
+  FINDBUGS_HOME := $(call DirExists,/usr/share/findbugs,$(JDK_DEVTOOLS_DIR)/share/findbugs/latest,)
+endif
+ifeq ($(FINDBUGS_HOME),)
+  FINDBUGS = findbugs
+else
+  FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
+endif
+
 ifdef ALT_COPYRIGHT_YEAR
   COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
 else
--- a/jdk/make/common/shared/Sanity.gmk	Tue Mar 18 11:06:34 2008 -0700
+++ b/jdk/make/common/shared/Sanity.gmk	Tue Mar 18 11:08:09 2008 -0700
@@ -105,13 +105,21 @@
 UNZIP_VER  :=$(call GetVersion,"$(_UNZIP_VER)")
 BOOT_VER   :=$(call GetVersion,"$(_BOOT_VER)")
 
-REQUIRED_ANT_VER      := 1.6.3
-_ANT_VER              :=$(shell $(ANT) -version 2>&1 )
-ANT_VER               :=$(call GetVersion,"$(_ANT_VER)")
+REQUIRED_ANT_VER := 1.6.3
+ifeq ($(ANT_HOME),)
+  _ANT_VER:=$(shell JAVACMD="$(BOOTDIR)/bin/java" $(ANT) -version 2>&1 )
+else
+  _ANT_VER:=$(shell JAVACMD="$(BOOTDIR)/bin/java" ANT_HOME="$(ANT_HOME)" $(ANT) -version 2>&1 )
+endif
+ANT_VER:=$(call GetVersion,"$(_ANT_VER)")
 
-REQUIRED_FINDBUGS_VER := 1.1
-_FINDBUGS_VER         :=$(shell $(FINDBUGS) -version 2>&1 )
-FINDBUGS_VER          :=$(call GetVersion,"$(_FINDBUGS_VER)")
+REQUIRED_FINDBUGS_VER := 1.2
+ifeq ($(FINDBUGS_HOME),)
+  _FINDBUGS_VER:=$(shell $(FINDBUGS) -javahome "$(BOOTDIR)" -textui -version 2>&1 )
+else
+  _FINDBUGS_VER:=$(shell FINDBUGS_HOME="$(FINDBUGS_HOME)" $(FINDBUGS) -javahome "$(BOOTDIR)" -textui -version 2>&1 )
+endif
+FINDBUGS_VER:=$(call GetVersion,"$(_FINDBUGS_VER)")
 
 ifdef ALT_BINDIR
   ALT_BINDIR_VERSION := $(shell $(ALT_BINDIR)/java$(EXE_SUFFIX) -version 2>&1  | $(NAWK) -F'"' '{ print $$2 }')