From: Niki Roo Date: Sat, 18 May 2019 12:35:03 +0000 (+0200) Subject: update Makefile.base: copy sources/doc in jar X-Git-Tag: nikiroo-utils-4.7.3~14 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=5a1f942d51553ab482d01c44bb093dd4187c0799;p=nikiroo-utils.git update Makefile.base: copy sources/doc in jar --- diff --git a/Makefile.base b/Makefile.base index 92e8e8e..fe47347 100644 --- a/Makefile.base +++ b/Makefile.base @@ -7,6 +7,7 @@ # - 1.2.1: improve 'apk' and add 'android' # - 1.3.0: add 'man' for man(ual) pages # - 1.4.0: remove android stuff (not working anyway) +# - 1.5.0: include sources and readme/changelog in jar # Required parameters (the commented out ones are supposed to be per project): @@ -137,19 +138,27 @@ libs: bin @[ ! -d libs ] || touch bin/libs $(NAME)-sources.jar: libs + @ls *.md >/dev/null || cp VERSION README.md @echo Making sources JAR file... @echo > bin/manifest - @[ "$(SJAR_FLAGS)" = "" ] || echo Creating $(NAME)-sources.jar... - @[ "$(SJAR_FLAGS)" = "" ] || $(JAR) cfm $(NAME)-sources.jar bin/manifest $(SJAR_FLAGS) - @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`-sources.jar"... - @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || cp $(NAME)-sources.jar "$(NAME)-`cat VERSION`-sources.jar" + @[ "$(SJAR_FLAGS)" != "" ] || echo No sources JAR file defined, skipping + @[ "$(SJAR_FLAGS)" = "" ] || echo Creating $(NAME)-sources.jar... + @[ "$(SJAR_FLAGS)" = "" ] || $(JAR) cfm $(NAME)-sources.jar bin/manifest -C ./ *.md $(SJAR_FLAGS) + @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`-sources.jar"... + @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || cp $(NAME)-sources.jar "$(NAME)-`cat VERSION`-sources.jar" $(NAME).jar: resources @[ -e bin/$(MAIN).class ] || echo You need to build the sources @[ -e bin/$(MAIN).class ] + @ls *.md >/dev/null || cp VERSION README.md + @echo "Copying documentation into bin/..." + @cp -r *.md bin/ || cp VERSION bin/no-documentation.md + @echo "Copying sources into bin/..." + @cp -r src/* bin/ + @echo "Making jar..." @echo "Main-Class: `echo "$(MAIN)" | sed 's:/:.:g'`" > bin/manifest @echo >> bin/manifest - $(JAR) cfm $(NAME).jar bin/manifest $(JAR_FLAGS) + $(JAR) cfm $(NAME).jar bin/manifest -C ./ *.md $(JAR_FLAGS) @[ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`.jar"... @[ ! -e VERSION ] || cp $(NAME).jar "$(NAME)-`cat VERSION`.jar"