[java-libglom] Generate a *-javadoc.jar too, as needed by the sonatype.org repository.



commit d3867be6d5b6fe36b51ff24bd47a151921b3bd66
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jan 18 14:47:34 2012 +0100

    Generate a *-javadoc.jar too, as needed by the sonatype.org repository.
    
    * Makefile.am: Explicitly call javadoc and jar to generate the
    documentation jar.

 ChangeLog   |    9 ++++++++-
 Makefile.am |   16 +++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e42e9c6..0f40f26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-01-18  Murray Cumming  <murrayc murrayc com>
+
+	Generate a *-javadoc.jar too, as needed by the sonatype.org repository.
+
+	* Makefile.am: Explicitly call javadoc and jar to generate the 
+	documentation jar.
+
 1.21.1:
 
 2012-01-16  Murray Cumming  <murrayc murrayc com>
@@ -19,7 +26,7 @@
 
 2012-01-10  Murray Cumming  <murrayc murrayc com>
 
-	.pom file: Adjust so we can upload to the sonatype.org resository.
+	.pom file: Adjust so we can upload to the sonatype.org repository.
 
 	* java-libglom.pom.in: Change the scm to something like the git scm 
 	example here, though the syntax is not clear:
diff --git a/Makefile.am b/Makefile.am
index 9529e60..63d6992 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,6 +27,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=fatal
 SUBDIRS =
 
 jarfile = java-libglom- PACKAGE_VERSION@.jar
+doc_jarfile = java-libglom- PACKAGE_VERSION@-javadoc.jar
 jardir = $(datadir)/java
 
 generated_java_sources = src/main/java/org/glom/libglom/BakeryDocument.java \
@@ -89,6 +90,7 @@ swig_sources = src/glom.i \
                src/std_list.i
 
 java_binaries = $(top_builddir)/$(jarfile) \
+                $(top_builddir)/$(doc_jarfile) \
                 $(top_builddir)/org/glom/libglom/*.class \
                 $(top_builddir)/src/test/java/org/glom/libglom/tests/*.class \
                 $(top_builddir)/src/examples/org/glom/libglom/examples/*.class
@@ -101,6 +103,10 @@ CLEANFILES = $(java_binaries) tests-and-examples.stamp
 swig_dependencies =
 endif
 
+#We use this special target because CLEANFILES cannot contain a whole directory.
+clean-local:
+	$(RM) -rf $(top_builddir)/doc
+
 dist_noinst_JAVA = $(generated_java_sources)
 
 test_sources = src/test/java/org/glom/libglom/tests/DocumentTest.java \
@@ -139,7 +145,7 @@ src/glom_wrap.cc: $(swig_dependencies)
 $(jarfile): classdist_noinst.stamp
 	$(JAR) cf $(JARFLAGS) $(top_builddir)/$(jarfile) org
 
-all-local: tests-and-examples.stamp
+all-local: $(jarfile) $(doc_jarfile) tests-and-examples.stamp
 
 # This uses mvn to install the .jar file in the local .m2 directory.
 # and install our .pom file alongside it.
@@ -170,3 +176,11 @@ tests-and-examples.stamp: $(jarfile) $(test_sources)
 
 deploy: $(pomfile) $(jarfile) 
 	mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=$(pomfile) -Dfile=$(jarfile)
+
+
+docbuild: $(jarfile)
+	javadoc -public $(top_srcdir)/src/main/java/org/glom/libglom/*.java -d doc
+
+$(doc_jarfile): docbuild
+	$(JAR) cf $(JARFLAGS) $(top_builddir)/$(doc_jarfile) doc/*
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]