forked from amplitude/Amplitude-Android
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
119 lines (100 loc) · 4.92 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<project name="Amplitude Android SDK" basedir="." default="dist" xmlns:artifact="urn:maven-artifact-ant">
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant"
classpath="lib/maven-ant-tasks-2.1.3.jar" />
<description />
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property environment="env" />
<property name="android-sdk-path" value="${env.ANDROID_SDK}" />
<property name="android-target" value="${env.ANDROID_TARGET}" />
<property name="groupId" value="com.amplitude" />
<property name="artifactId" value="android-sdk" />
<property name="version" value="1.2" />
<property name="jar" value="${dist}/lib/${artifactId}-${version}.jar" />
<property name="javadoc-jar" value="${dist}/lib/${artifactId}-${version}-javadoc.jar" />
<property name="sources-jar" value="${dist}/lib/${artifactId}-${version}-sources.jar" />
<path id="project.class.path">
<pathelement path="${android-sdk-path}/platforms/android-${android-target}/android.jar" />
</path>
<target name="init">
<mkdir dir="${build}" />
<mkdir dir="${dist}/lib" />
</target>
<target name="clean" >
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="build" depends="init" >
<javac classpathref="project.class.path"
srcdir="${src}"
destdir="${build}"
includeantruntime="false" />
</target>
<target name="jar" depends="build" >
<jar destfile="${jar}" basedir="${build}" includes="com/amplitude/api/*.class" />
</target>
<target name="unity" depends="build" >
<jar destfile="amplitude-unity.jar">
<fileset dir="${build}" includes="com/amplitude/api/*.class" />
<fileset dir="${src}" includes="com/amplitude/api/*.java" />
<fileset dir="${build}" includes="com/amplitude/unity/plugins/*.class" />
<fileset dir="${src}" includes="com/amplitude/unity/plugins/*.java" />
</jar>
</target>
<target name="dist" depends="jar">
<javadoc classpathref="project.class.path" sourcepath="${src}" destdir="${dist}/javadoc">
<fileset dir="${src}" includes="com/amplitude/api/*.java" />
</javadoc>
<jar jarfile="${javadoc-jar}">
<fileset dir="${dist}/javadoc" />
</jar>
<jar jarfile="${sources-jar}">
<fileset dir="${src}" includes="com/amplitude/api/*.java" />
</jar>
</target>
<property name="ossrh-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots" />
<property name="ossrh-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2" />
<property name="ossrh-server-id" value="ossrh" />
<!-- version in build.xml and pom.xml must be -SNAPSHOT -->
<target name="deploy" depends="dist" description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" />
<arg value="-Durl=${ossrh-snapshots-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${jar}" />
</artifact:mvn>
</target>
<!-- version in build.xml and pom.xml must NOT be -SNAPSHOT -->
<target name="stage" depends="dist" description="deploy release version to Maven staging repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${jar}" />
<arg value="-Pgpg" />
</artifact:mvn>
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${sources-jar}" />
<arg value="-Dclassifier=sources" />
<arg value="-Pgpg" />
</artifact:mvn>
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${javadoc-jar}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
</project>