Merge lp:~karni/ubuntu-sso-java-library/ant-setup into lp:ubuntu-sso-java-library

Proposed by Michał Karnicki
Status: Merged
Merged at revision: 25
Proposed branch: lp:~karni/ubuntu-sso-java-library/ant-setup
Merge into: lp:ubuntu-sso-java-library
Diff against target: 319 lines (+148/-117)
5 files modified
.bzrignore (+9/-7)
HACKING.txt (+1/-2)
ant.properties (+43/-0)
build.xml (+95/-30)
setup.sh (+0/-78)
To merge this branch: bzr merge lp:~karni/ubuntu-sso-java-library/ant-setup
Reviewer Review Type Date Requested Status
Chad Miller Pending
Review via email: mp+99338@code.launchpad.net

Description of the change

Replaced old bash setup script with ant for downloading dependencies.
Updated library jar name to libUbuntuSSO-<version>.jar

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-07-21 21:21:11 +0000
3+++ .bzrignore 2012-03-26 14:20:41 +0000
4@@ -1,9 +1,11 @@
5 bin
6 dist
7-libs/commons-codec-1.4.jar
8-libs/commons-logging-1.1.1.jar
9-libs/httpclient-4.1.1.jar
10-libs/httpcore-4.1.jar
11-libs/json-20090211.jar
12-libs/signpost-commonshttp4-1.2.1.1.jar
13-libs/signpost-core-1.2.1.1.jar
14+libs/signpost-commonshttp4-*.jar
15+libs/signpost-core-*.jar
16+libs/commons-codec-*.jar
17+libs/commons-logging-*.jar
18+libs/httpcore-*.jar
19+libs/httpclient-*.jar
20+libs/json-*.jar
21+libs/junit-*.jar
22+
23
24=== modified file 'HACKING.txt'
25--- HACKING.txt 2011-07-21 21:21:11 +0000
26+++ HACKING.txt 2012-03-26 14:20:41 +0000
27@@ -1,4 +1,3 @@
28 To build, run:
29-$ ./setup.sh
30-$ ant build
31+$ ant setup
32 $ ant jar
33
34=== added file 'ant.properties'
35--- ant.properties 1970-01-01 00:00:00 +0000
36+++ ant.properties 2012-03-26 14:20:41 +0000
37@@ -0,0 +1,43 @@
38+java.encoding=UTF-8
39+
40+# Library versions.
41+
42+lib.signpost.ver=1.2.1.1
43+lib.commons-codec.ver=1.4
44+lib.commons-logging.ver=1.1.1
45+lib.httpcore.ver=4.1.3
46+lib.httpclient.ver=4.1.3
47+lib.json.ver=20090211
48+
49+lib.junit.ver=4.10
50+
51+# Library jar file names.
52+
53+lib.signpost-core.jar=signpost-core-${lib.signpost.ver}.jar
54+lib.signpost-commonshttp4.jar=signpost-commonshttp4-${lib.signpost.ver}.jar
55+lib.commons-codec.jar=commons-codec-${lib.commons-codec.ver}.jar
56+lib.commons-logging.jar=commons-logging-${lib.commons-logging.ver}.jar
57+lib.httpcore.jar=httpcore-${lib.httpcore.ver}.jar
58+lib.httpclient.jar=httpclient-${lib.httpclient.ver}.jar
59+lib.json.jar=json-${lib.json.ver}.jar
60+
61+lib.junit.jar=junit-${lib.junit.ver}.jar
62+
63+# Library jar download urls
64+
65+url.oasp=http://oauth-signpost.googlecode.com/files
66+lib.signpost-core.url=${url.oasp}/${lib.signpost-core.jar}
67+lib.signpost-commonshttp4.url=${url.oasp}/${lib.signpost-commonshttp4.jar}
68+
69+url.ibiblio=http://mirrors.ibiblio.org/pub/mirrors/maven2
70+lib.commons-codec.url=${url.ibiblio}/commons-codec/commons-codec/${lib.commons-codec.ver}/${lib.commons-codec.jar}
71+lib.commons-logging.url=${url.ibiblio}/commons-logging/commons-logging/${lib.commons-logging.ver}/${lib.commons-logging.jar}
72+lib.httpcore.url=${url.ibiblio}/org/apache/httpcomponents/httpcore/${lib.httpcore.ver}/${lib.httpcore.jar}
73+lib.httpclient.url=${url.ibiblio}/org/apache/httpcomponents/httpclient/${lib.httpclient.ver}/${lib.httpclient.jar}
74+lib.json.url=${url.ibiblio}/org/json/json/${lib.json.ver}/${lib.json.jar}
75+
76+lib.junit.url=${url.ibiblio}/junit/junit/${lib.junit.ver}/${lib.junit.jar}
77+
78+# Only used by official ubuntuone-hackers team.
79+
80+project.version=0.1.0
81
82=== modified file 'build.xml'
83--- build.xml 2011-07-21 21:21:11 +0000
84+++ build.xml 2012-03-26 14:20:41 +0000
85@@ -1,26 +1,88 @@
86 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
87-<project basedir="." default="build" name="ubuntu-sso-java-client">
88- <property environment="env" />
89- <property file="local.properties" />
90+<project name="ubuntu-sso-java-library" basedir="." default="jar">
91+
92+ <description>
93+ *** Ubuntu SSO Java library ***
94+
95+ Ubuntu Single Sign On Java library
96+
97+ http://one.ubuntu.com
98+ http://one.ubuntu.com/developer
99+ http://login.ubuntu.com
100+ http://launchpad.net/ubuntu-sso-java-library
101+
102+ IRC: #ubuntuone @ irc.freenode.net
103+
104+ For instructions on building, see HACKING.txt
105+ </description>
106+
107+ <property file="ant.properties" />
108+
109 <property name="debuglevel" value="source,lines,vars" />
110 <property name="target" value="1.6" />
111 <property name="source" value="1.6" />
112- <property name="ECLIPSE_HOME" value="/usr/lib/eclipse" />
113- <path id="JUnit 4.libraryclasspath">
114- <pathelement location="${ECLIPSE_HOME}/plugins/org.junit4_4.5.0.v20090824/junit.jar" />
115- <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.jar" />
116- </path>
117- <path id="ubuntu-sso-java-client.classpath">
118+
119+ <property name="libs" value="libs" />
120+
121+ <target name="clean-libs">
122+ <delete dir="${libs}" quiet="true" />
123+ <mkdir dir="${libs}" />
124+ </target>
125+
126+ <path id="ubuntu-sso-java-library.classpath">
127 <pathelement location="bin" />
128- <pathelement location="libs/json-20090211.jar" />
129- <pathelement location="libs/commons-codec-1.4.jar" />
130- <pathelement location="libs/commons-logging-1.1.1.jar" />
131- <pathelement location="libs/httpcore-4.1.jar" />
132- <pathelement location="libs/httpclient-4.1.1.jar" />
133- <pathelement location="libs/signpost-core-1.2.1.1.jar" />
134- <pathelement location="libs/signpost-commonshttp4-1.2.1.1.jar" />
135- <path refid="JUnit 4.libraryclasspath" />
136+ <pathelement location="libs/${lib.signpost-core.jar}" />
137+ <pathelement location="libs/${lib.signpost-commonshttp4.jar}" />
138+ <pathelement location="libs/${lib.commons-codec.jar}" />
139+ <pathelement location="libs/${lib.commons-logging.jar}" />
140+ <pathelement location="libs/${lib.httpcore.jar}" />
141+ <pathelement location="libs/${lib.httpclient.jar}" />
142+ <pathelement location="libs/${lib.json.jar}" />
143+
144+ <pathelement location="libs/${lib.junit.jar}" />
145 </path>
146+
147+ <target name="get-libs">
148+ <mkdir dir="${libs}" />
149+
150+ <!-- SignPost Core -->
151+ <get src="${lib.signpost-core.url}" dest="${libs}"
152+ verbose="on" usetimestamp="true" maxtime="30" />
153+
154+ <!-- SignPost CommonsHttp4 -->
155+ <get src="${lib.signpost-commonshttp4.url}" dest="${libs}"
156+ verbose="on" usetimestamp="true" maxtime="30" />
157+
158+ <!-- Commons Codec -->
159+ <get src="${lib.commons-codec.url}" dest="${libs}"
160+ verbose="on" usetimestamp="true" maxtime="30" />
161+
162+ <!-- Commons Logging -->
163+ <get src="${lib.commons-logging.url}" dest="${libs}"
164+ verbose="on" usetimestamp="true" maxtime="30" />
165+
166+ <!-- HttpCore -->
167+ <get src="${lib.httpcore.url}" dest="${libs}"
168+ verbose="on" usetimestamp="true" maxtime="30" />
169+
170+ <!-- HttpClient -->
171+ <get src="${lib.httpclient.url}" dest="${libs}"
172+ verbose="on" usetimestamp="true" maxtime="30" />
173+
174+ <!-- JSON -->
175+ <get src="${lib.json.url}" dest="${libs}"
176+ verbose="on" usetimestamp="true" maxtime="30" />
177+
178+ <!-- JUnit4 -->
179+ <get src="${lib.junit.url}" dest="${libs}"
180+ verbose="on" usetimestamp="true" maxtime="60" />
181+ </target>
182+
183+ <target name="setup" depends="get-libs"
184+ description="Download project depenencies.">
185+ <echo message="Downloaded all project dependencies." />
186+ </target>
187+
188 <target name="init">
189 <mkdir dir="bin" />
190 <copy includeemptydirs="false" todir="bin">
191@@ -36,29 +98,32 @@
192 </fileset>
193 </copy>
194 </target>
195+
196 <target name="clean">
197 <delete dir="bin" />
198 <delete dir="dist" />
199 </target>
200- <target depends="clean" name="cleanall" />
201- <target depends="build-subprojects,build-project" name="build" />
202- <target name="build-subprojects" />
203- <target depends="build-project" name="jar">
204- <mkdir dir="dist" />
205- <exec executable="/usr/bin/bzr" dir="." outputproperty="bzr.revno">
206- <arg value="revno" />
207- </exec>
208- <jar basedir="bin" destfile="dist/${ant.project.name}-rev${bzr.revno}.jar" />
209- </target>
210- <target depends="init" name="build-project">
211+
212+ <target name="cleanall" depends="clean, clean-libs" />
213+
214+ <target name="build" depends="build-project" />
215+
216+ <target name="build-project" depends="init" >
217 <echo message="${ant.project.name}: ${ant.file}" />
218 <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
219 <src path="src" />
220- <classpath refid="ubuntu-sso-java-client.classpath" />
221+ <classpath refid="ubuntu-sso-java-library.classpath" />
222 </javac>
223 <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
224 <src path="test" />
225- <classpath refid="ubuntu-sso-java-client.classpath" />
226+ <classpath refid="ubuntu-sso-java-library.classpath" />
227 </javac>
228 </target>
229+
230+ <target name="jar" depends="build-project"
231+ description="Package the library into a jar file.">
232+ <mkdir dir="dist" />
233+ <jar basedir="bin" destfile="dist/libUbuntuSSO-${project.version}.jar" />
234+ <echo message="Packaged the library into dist/libUbuntuSSO-${project.version}.jar" />
235+ </target>
236 </project>
237
238=== removed file 'setup.sh'
239--- setup.sh 2011-07-21 21:21:11 +0000
240+++ setup.sh 1970-01-01 00:00:00 +0000
241@@ -1,78 +0,0 @@
242-#!/bin/bash
243-
244-if test "$1" = "cleanlib"; then
245- rm libs/*
246- bzr revert libs/
247-fi
248-
249-PROJECTROOT=$(bzr root || pwd)
250-
251-if test -z "${DOWNLOADER}"; then which wget >/dev/null && DOWNLOADER="$(which wget) --no-verbose -O "; fi
252-if test -z "${DOWNLOADER}"; then which curl >/dev/null && DOWNLOADER="$(which curl) -o "; fi
253-
254-if test -z "${DOWNLOADER}"; then
255- echo "Need wget or curl to download." >&2
256- return 1
257-fi
258-
259-trap "echo ' ==== Not Successful. ===='" EXIT
260-set -e
261-
262-echo "Downloading dependencies."
263-pushd "${PROJECTROOT}"/libs
264-
265-first() { printf -v $1 "%s" $2; }
266-
267-generaldownload() {
268- local filename=$1
269- local urlstart=$2
270- echo " - ${filename}"
271- if test -f "${filename}" && file "${filename}" |grep -i "zip archive" >/dev/null; then
272- :
273- else
274- rm -f "${filename}"
275- first nearby_copy ../../*/libs/${filename}
276- cp -v -l ${nearby_copy} . || ${DOWNLOADER} "${filename}" "${urlstart}/${filename}"
277- fi
278- file "${filename}" |grep -i "zip archive" >/dev/null
279- return $?
280-}
281-
282-mavendownload() {
283- local groupid=$1
284- local artifactid=$2
285- local vers=$3
286- generaldownload \
287- "${artifactid}-${vers}.jar" \
288- "http://mirrors.ibiblio.org/pub/mirrors/maven2/${groupid}/${artifactid}/${vers}"
289- return $?
290-}
291-
292-
293-# If you add new downloadable jar files here, please add a wildcard to
294-# ".bzrignore" to match it in libs/ , and "bzr remove" the existing file if
295-# it's in the branch.
296-SIGNPOSTVER=1.2.1.1
297-generaldownload "signpost-core-${SIGNPOSTVER}.jar" "http://oauth-signpost.googlecode.com/files"
298-generaldownload "signpost-commonshttp4-${SIGNPOSTVER}.jar" "http://oauth-signpost.googlecode.com/files"
299-
300-CODECVER=1.4
301-generaldownload "commons-codec-${CODECVER}.jar" "http://mirrors.ibiblio.org/pub/mirrors/maven2/commons-codec/commons-codec/${CODECVER}/"
302-
303-LOGGINGVER=1.1.1
304-generaldownload "commons-logging-${LOGGINGVER}.jar" "http://mirrors.ibiblio.org/pub/mirrors/maven2/commons-logging/commons-logging/${LOGGINGVER}/"
305-
306-HTTPCOREVER=4.1
307-generaldownload "httpcore-${HTTPCOREVER}.jar" "http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/httpcomponents/httpcore/${HTTPCOREVER}/"
308-
309-HTTPCLIENTVER=4.1.1
310-generaldownload "httpclient-${HTTPCLIENTVER}.jar" "http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/httpcomponents/httpclient/${HTTPCLIENTVER}/"
311-
312-JSONVER=20090211
313-generaldownload "json-${JSONVER}.jar" "http://mirrors.ibiblio.org/pub/mirrors/maven2/org/json/json/${JSONVER}/"
314-
315-popd
316-
317-echo
318-trap EXIT
319-

Subscribers

People subscribed via source and target branches