diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-10-28 12:46:02 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-10-28 12:46:02 -0400 |
commit | 5996e0abe77fe235b0eafbe75d38111a38ed99f9 (patch) | |
tree | b89b02097fb00f60fef6aa225aaeffbab6656ba7 |
initial commit
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Makefile | 74 | ||||
-rw-r--r-- | apache-maven-version.txt | 1 | ||||
-rwxr-xr-x | main.sh | 43 | ||||
-rw-r--r-- | maven-svn-map.txt | 13 | ||||
-rw-r--r-- | slf4j-version.txt | 1 |
6 files changed, 136 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ffc4c6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/upstream/ +/build/ +/maven-svn-version.txt +/network
\ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..abb04a2 --- /dev/null +++ b/Makefile @@ -0,0 +1,74 @@ +top=$(shell pwd) + +all: extract + +extract: \ + build/maven \ + build/maven-extras \ + build/slf4j +download: \ + upstream/apache-maven-$(shell cat apache-maven-version.txt) \ + upstream/maven-svn + upstream/slf4j-git + +# touch this file to trigger network updates +network: + touch $@ + +################################################################################ + +mvn_ver=$(shell cat apache-maven-version.txt) +upstream/apache-maven-${mvn_ver}-src.tar.gz: upstream/apache-maven-%-src.tar.gz: + ver=$* && \ + mirror='http://archive.apache.org/dist' && \ + mkdir -p ${@D} && \ + wget -c -O $@ "$${mirror}/maven/maven-$${ver%%.*}/$${ver}/source/${@F}" +upstream/apache-maven-${mvn_ver}: upstream/apache-maven-%: upstream/apache-maven-%-src.tar.gz + cd ${@D} && tar xaf "${top}/$<" + cd $@ && git init && git add . && git commit -m 'tarball of apache maven $*' +build/maven: upstream/apache-maven-${mvn_ver} + rm -rf $@ + mkdir -p $@ + lndir -silent "${top}/$<" "${top}/$@" + +################################################################################ + +upstream/maven-svn: maven-svn-map.txt network + if ! [[ -d "$@/.svn" ]]; then \ + mkdir -p ${@D} && \ + svn checkout --depth=empty https://svn.apache.org/repos/asf/maven "$@"; \ + else \ + cd "$@" && svn update; \ + fi + cd "$@" && \ + while read svnpath localpath; do \ + svn update --parents "$$svnpath"; \ + done <"${top}/$<" + touch $@ +maven-svn-version.txt: upstream/maven-svn maven-svn-map.txt + while read svnpath localpath; do \ + cd "${top}/$</$${svnpath}" && \ + LANG=C svn log -l 1 .|sed -n 2p; \ + done <"${top}/maven-svn-map.txt" | \ + cut -d'|' -f3 | date --file=- --utc --iso-8601 | sort | sed -n '$$p' > "${top}/$@" +build/maven-extras: upstream/maven-svn maven-svn-map.txt + rm -rf $@ + mkdir -p $@ + while read svnpath localpath; do \ + mkdir -p "${top}/$@/$${localpath}" && \ + lndir -silent "${top}/$</$${svnpath}" "${top}/$@/$${localpath}"; \ + done <maven-svn-map.txt + +################################################################################ + +upstream/slf4j-git: slf4j-version.txt network + if ! [[ -d "$@/.git" ]]; then \ + git clone git://github.com/qos-ch/slf4j.git "$@"; \ + else \ + cd "$@" && git fetch --all -p; \ + fi + cd "$@" && git checkout v_$$(cat "${top}/$<") +build/slf4j: upstream/slf4j-git + rm -rf $@ + mkdir -p $@ + lndir -silent "${top}/$<" "${top}/$@" diff --git a/apache-maven-version.txt b/apache-maven-version.txt new file mode 100644 index 0000000..94ff29c --- /dev/null +++ b/apache-maven-version.txt @@ -0,0 +1 @@ +3.1.1 @@ -0,0 +1,43 @@ +#!/bin/bash +set -e + +readonly top=$PWD + +# local remote +map=( +) + +# SVN init +if ! [[ -d "${top}/upstream/maven-svn/.svn" ]]; then + cd "${top}" + svn checkout --depth=empty https://svn.apache.org/repos/asf/maven svn +else + cd "${top}/svn" + svn update +fi + +# SVN checkout +cd "${top}/upstream/maven-svn" +for pair in "${map[@]}"; do + read svnpath localpath <<<"$pair" + svn update --parents "$svnpath" +done + +# Detect version +echo 'Finding last modified date...' +for pair in "${map[@]}"; do + read svnpath localpath <<<"$pair" + cd "${top}/upstream/maven-svn/${svnpath}" + LANG=C svn log -l 1 .|sed -n 2p +done | +cut -d'|' -f3 | date --file=- --utc --iso-8601 | sort | sed -n '$p' > "${top}/date.txt" + +# Create working directory +cd "${top}" +rm -rf build +mkdir build +for pair in "${map[@]}"; do + read svnpath localpath <<<"$pair" + mkdir -p "${top}/build/${localpath}" + lndir -silent "${top}/upstream/maven-svn/${svnpath}" "${top}/build/${localpath}" +done diff --git a/maven-svn-map.txt b/maven-svn-map.txt new file mode 100644 index 0000000..8e8ccee --- /dev/null +++ b/maven-svn-map.txt @@ -0,0 +1,13 @@ +enforcer/tags/enforcer-1.3 enforcer +plugin-tools/tags/maven-plugin-tools-3.2 plugin-tools +plugins/tags/maven-clean-plugin-2.5 plugins/maven-clean-plugin +plugins/tags/maven-compiler-plugin-3.1 plugins/maven-compiler-plugin +plugins/tags/maven-deploy-plugin-2.8.1 plugins/maven-deploy-plugin +plugins/tags/maven-install-plugin-2.5.1 plugins/maven-install-plugin +plugins/tags/maven-plugins-24 plugins/maven-plugins +plugins/tags/maven-remote-resources-plugin-1.5 plugins/maven-remote-resources-plugin +plugins/tags/maven-resources-plugin-2.6 plugins/maven-resources-plugin +plugins/tags/maven-site-plugin-3.3 plugins/maven-site-plugin +plugins/tags/maven-verifier-plugin-1.0 plugins/maven-verifier-plugin +pom/tags/apache-13 pom/asf +pom/tags/maven-parent-23 pom/maven diff --git a/slf4j-version.txt b/slf4j-version.txt new file mode 100644 index 0000000..6a126f4 --- /dev/null +++ b/slf4j-version.txt @@ -0,0 +1 @@ +1.7.5 |