summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-07-22 23:50:27 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-07-22 23:50:27 -0400
commit755761fbdd192e781c956e5bb64eb2ab0dcf86dc (patch)
treea5ac287bc8651d422cf4dea014ee05f82369f35e
parentac1085576deb2782e84c7d3fbeab21ebfb81cbdf (diff)
Also build Guice extensions
I gave it -bootstrap because I did disable the 'struts2' and 'spring' extensions.
-rw-r--r--Makefile4
-rw-r--r--conf/dependencies.mk5
-rw-r--r--conf/sources.mk2
-rw-r--r--rules/generic/Makefile10
-rw-r--r--rules/guice-bootstrap/delete.list3
-rw-r--r--rules/guice-bootstrap/subdir-deps.mk7
-rw-r--r--rules/guice-core/sourceDirectory.mk1
7 files changed, 23 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 23ec154..2c1a28b 100644
--- a/Makefile
+++ b/Makefile
@@ -141,14 +141,16 @@ deps2bindirs = $(if $1,$(sort $(shell $(FIND) $1 -type f -executable -printf '%h
sanitize_bindirs = $(filter-out $(subst :, ,$(PATH)),$(abspath $1))
deps2path = $(shell $(ECHO) $(call sanitize_bindirs,$(call deps2bindirs,$1)) $(PATH) | $(SED) 'y/ /:/')
-recurse = PATH='$(call deps2path,$^)' CLASSPATH='$(call deps2classpath,$^)' extra_makefiles='$(abspath $(wildcard rules/$*/*.mk))' $(MAKE) -C build/workdir/$* -f '$1' install DESTDIR='$(top)/$@'
+recurse = PATH='$(call deps2path,$^)' CLASSPATH='$(call deps2classpath,$^)' extra_makefiles='$(abspath $(wildcard rules/$*/*.mk))' $(MAKE) -C build/workdir/$* -f '$1' install DESTDIR='$(top)/$@' && $(EXISTS) '$@'
$(addprefix build/packages/,$(package_specific)): \
build/packages/%: RECURSIVE build/workdir/% rules/%/Makefile
+ for dep in $(filter-out RECURSIVE,$^); do $(EXISTS) $$dep || { $(RM) -r '$@'; $(FAIL); }; done
$(call recurse,$(top)/rules/$*/Makefile) || { $(RM) -r '$@'; $(FAIL); }
$(addprefix build/packages/,$(package_generic)): \
build/packages/%: RECURSIVE build/workdir/% rules/generic/Makefile
+ for dep in $(filter-out RECURSIVE,$^); do $(EXISTS) $$dep || { $(RM) -r '$@'; $(FAIL); }; done
$(call recurse,$(top)/rules/generic/Makefile) || { $(RM) -r '$@'; $(FAIL); }
# boilerplate ##################################################################
diff --git a/conf/dependencies.mk b/conf/dependencies.mk
index 11aa0d2..d515f4d 100644
--- a/conf/dependencies.mk
+++ b/conf/dependencies.mk
@@ -34,6 +34,7 @@ dep-jsr315 = $(dep-servlet30) # "Java Servlet 3.0 Specificat
dep-jsr330 = build/packages/atinject-javax.inject # "Dependency Injection for Java"
dep-jsr340 = $(dep-servlet31) # "Java Servlet 3.1 Specification"
+dep-jpa10 = $(dep-jpa20)
dep-jpa20 = build/packages/eclipselink-persistence20
dep-jpa21 = build/packages/eclipselink-persistence21
@@ -178,8 +179,10 @@ build/packages/cglib: \
build/packages/jarjar
build/packages/guava: \
$(dep-jsr305)
-build/packages/guice-core: \
+build/packages/guice-bootstrap: \
$(dep-jsr330) \
+ $(dep-jpa10) \
+ $(dep-servlet25) \
build/packages/aopalliance \
build/packages/asm3 \
build/packages/cglib
diff --git a/conf/sources.mk b/conf/sources.mk
index 1e44a3d..0915014 100644
--- a/conf/sources.mk
+++ b/conf/sources.mk
@@ -82,7 +82,7 @@ cal10n = tar|https://github.com/qos-ch/cal
cglib = tar|https://github.com/cglib/cglib/archive/RELEASE_3_1.tar.gz
gradle = tar|https://services.gradle.org/distributions/gradle-1.12-src.zip
groovy = tar|https://dl.bintray.com/groovy/maven/groovy-src-2.3.3.zip
-guice-core = tar|https://google-guice.googlecode.com/files/guice-3.0-src.zip|core
+guice-bootstrap = tar|https://google-guice.googlecode.com/files/guice-3.0-src.zip
#javacc = tar|https://java.net/projects/javacc/downloads/download/javacc-6.0src.zip
javassist = tar|https://github.com/jboss-javassist/javassist/archive/rel_3_18_2_ga.tar.gz
jline = tar|https://downloads.sourceforge.net/project/jline/jline/1.0/jline-1.0.zip|src
diff --git a/rules/generic/Makefile b/rules/generic/Makefile
index 7549439..dbadab2 100644
--- a/rules/generic/Makefile
+++ b/rules/generic/Makefile
@@ -22,17 +22,17 @@ TOUCH = touch
XMLSTARLET = xml
# Detect information from POMs
-basedir = .
-project.basedir = $(basedir)
-
artifactId := $(shell $(XMLSTARLET) sel -T -t -c /_:project/_:artifactId -n pom.xml)
version := $(firstword $(shell $(XMLSTARLET) sel -T -t -c /_:project/_:version -n -c /_:project/_:parent/_:version pom.xml) $(version))
groupId := $(firstword $(shell $(XMLSTARLET) sel -T -t -c /_:project/_:groupId -n -c /_:project/_:parent/_:groupId pom.xml))
-sourceDirectory := $(firstword $(shell $(XMLSTARLET) sel -T -t -c /_:project/_:build/_:sourceDirectory -n pom.xml) $(sourceDirectory) src/main/java)
+sourceDirectory := $(firstword $(shell $(XMLSTARLET) sel -T -t -c /_:project/_:build/_:sourceDirectory -n pom.xml) $(value sourceDirectory) src/main/java)
+$(eval sourceDirectory = $(sourceDirectory))
resources := $(shell $(XMLSTARLET) sel -T -t -c /_:project/_:build/_:resources -n pom.xml)
resources := $(if $(resources),$(resources),src/main/resources)
+basedir = .
+project.basedir = $(basedir)
subdirs = $(patsubst %/pom.xml,%,$(wildcard */pom.xml))
targets = pom $(if $(wildcard src/main/ $(sourceDirectory) $(resources)),jar)
@@ -119,7 +119,7 @@ deps2classpath = $(shell $(ECHO) $(abspath $(call deps2jars,$1)) $(CLASSPATH) |
define recurse-rule
$1/%: PHONY $(addsuffix /all,$($1_deps))
- CLASSPATH='$$(call deps2classpath,$$^)' sourceDirectory='$$(sourceDirectory)' version='$$(version)' $$(MAKE) -C '$1' -f '$$(abspath $$(firstword $$(MAKEFILE_LIST)))' '$$*'
+ CLASSPATH='$$(call deps2classpath,$$^)' sourceDirectory='$$(value sourceDirectory)' version='$$(value version)' $$(MAKE) -C '$1' -f '$$(abspath $$(firstword $$(MAKEFILE_LIST)))' '$$*'
endef
$(foreach subdir,$(subdirs),$(eval $(call recurse-rule,$(subdir))))
diff --git a/rules/guice-bootstrap/delete.list b/rules/guice-bootstrap/delete.list
new file mode 100644
index 0000000..e86a1d8
--- /dev/null
+++ b/rules/guice-bootstrap/delete.list
@@ -0,0 +1,3 @@
+lib/build
+lib/*.jar
+extensions/*/build
diff --git a/rules/guice-bootstrap/subdir-deps.mk b/rules/guice-bootstrap/subdir-deps.mk
new file mode 100644
index 0000000..0058ab7
--- /dev/null
+++ b/rules/guice-bootstrap/subdir-deps.mk
@@ -0,0 +1,7 @@
+# top level
+extensions_deps = core
+
+# extensions
+struts2_deps = servlet
+subdirs := $(filter-out struts2,$(subdirs)) # depends on struts2, which depends on Spring, TestNG
+subdirs := $(filter-out spring,$(subdirs)) # depends on Spring
diff --git a/rules/guice-core/sourceDirectory.mk b/rules/guice-core/sourceDirectory.mk
deleted file mode 100644
index 4470673..0000000
--- a/rules/guice-core/sourceDirectory.mk
+++ /dev/null
@@ -1 +0,0 @@
-sourceDirectory = src