-
Notifications
You must be signed in to change notification settings - Fork 55
/
custom_rules.xml
178 lines (135 loc) · 7.64 KB
/
custom_rules.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0" encoding="UTF-8"?>
<project name="socialize-sdk-custom">
<target name="check-paths">
<property environment="env"/>
<echo>${env.PATH}</echo>
<condition property="sphinx.available">
<or>
<available file="sphinx-build" filepath="${env.PATH}"/>
</or>
</condition>
</target>
<target name="build" depends="javadoc, sphinx, zip"/>
<target name="doc" description="Uses sphinx to generate SDK documentation" depends="sphinx"/>
<!-- Python is required on target system for this to work!-->
<target name="sphinx" description="Uses sphinx to generate SDK documentation" if="sphinx.available" depends="check-paths">
<echo>Setting version in docs to ${version}</echo>
<copy file="doc/sphinx/source/conf_template.py" tofile="doc/sphinx/source/conf.py" overwrite="true"/>
<replaceregexp file="doc/sphinx/source/conf.py" match="\@socialize.version" replace="v${version}" flags="g" />
<delete dir="build/docs/static"/>
<delete dir="build/docs/user_guide" verbose="true"/>
<mkdir dir="build/docs/user_guide"/>
<exec executable="sphinx-build" failonerror="true" dir="${basedir}">
<arg value="-a"/>
<arg value="-E"/>
<arg value="doc/sphinx/source"/>
<arg value="build/docs/user_guide"/>
</exec>
<!-- Manually rename folders and references with underscore -->
<replaceregexp flags="g" match="_static" replace="static">
<fileset dir="build/docs/user_guide" includes="**/*.html **/*.js **/*.css"/>
</replaceregexp>
<replaceregexp flags="g" match="_images" replace="images">
<fileset dir="build/docs/user_guide" includes="**/*.html **/*.js **/*.css"/>
</replaceregexp>
<replaceregexp flags="g" match="_sources" replace="sources">
<fileset dir="build/docs/user_guide" includes="**/*.html **/*.js **/*.css"/>
</replaceregexp>
<move file="build/docs/user_guide/_static" tofile="build/docs/user_guide/static" verbose="true"/>
<move file="build/docs/user_guide/_images" tofile="build/docs/user_guide/images" verbose="true"/>
<move file="build/docs/user_guide/_sources" tofile="build/docs/user_guide/sources" verbose="true"/>
<copy
file="doc/read_me_first.html"
todir="build"
verbose="true"
failonerror="true"
overwrite="true"/>
<copy
file="doc/UPGRADING_README.txt"
todir="build"
verbose="true"
failonerror="true"
overwrite="true"/>
<delete file="doc/sphinx/source/conf.py"/>
</target>
<target name="javadoc" depends="-set-release-mode, -build-setup">
<path id="javadoc.classpath">
<path refid="project.target.class.path" />
<pathelement path="libext/commons-codec-1.4.jar"/>
</path>
<path id="javadoc.sourcepath">
<pathelement path="src"/>
</path>
<mkdir dir="build/docs/javadoc"/>
<tstamp>
<format property="year" pattern="yyyy" locale="en,UK" />
</tstamp>
<!-- add packagenames="com.socialize" to filter -->
<javadoc
stylesheetfile="doc/javadoc/stylesheet.css"
sourcepathref="javadoc.sourcepath"
classpathref="javadoc.classpath"
destdir="build/docs/javadoc"
doctitle="${vendor} SDK v${version} Documentation"
excludepackagenames="com.google.*,com.socialize.oauth.signpost.*,com.socialize.google.*,com.socialize.facebook.*,com.socialize.android.ioc.*">
<header>
<![CDATA[${vendor} SDK v${version} Documentation<br/>Copyright ${year} ${vendor}<br/><a href="${website}">${website}</a>]]>
</header>
<footer>
<![CDATA[Copyright ${year} ${vendor}<br/>${website}]]>
</footer>
<link
href="http://developer.android.com/reference/"
offline="true"
packagelistloc="${sdk.dir}/docs/reference"/>
<link href="http://www.json.org/javadoc/"/>
</javadoc>
</target>
<target name="zip">
<property name="tmp_dir" value="/tmp/sdk-build"/>
<delete dir="${tmp_dir}"/>
<mkdir dir="${tmp_dir}"/>
<copy todir="${tmp_dir}/demo">
<fileset dir="../demo/" excludes="*.iml,gen/**,bin/**,out/**,build/**,codetemplates.xml, local.properties"/>
</copy>
<copy todir="${tmp_dir}/sdk">
<fileset dir="../sdk/" excludes="*.iml,gen/**,bin/**,out/**,build/**,doc/**,icons/**,classes/**, codetemplates.xml, ant.properties, local.properties"/>
</copy>
<copy todir="${tmp_dir}/lib/android-ioc">
<fileset dir="../../android-ioc/core" excludes="*.iml,gen/**,bin/**,build/**,doc/**,codetemplates.xml, local.properties"/>
</copy>
<copy todir="${tmp_dir}/lib/facebook-android-sdk">
<fileset dir="../../facebook-android-sdk/facebook" excludes="*.iml,gen/**,bin/**,build/**,tests/**,TestApp/**,codetemplates.xml, local.properties"/>
</copy>
<copy todir="${tmp_dir}/lib/loopy-sdk-android">
<fileset dir="../../loopy-sdk-android/sdk" excludes="*.iml,gen/**,bin/**,build/**,doc/**,codetemplates.xml, local.properties"/>
</copy>
<!-- Set the version -->
<echo>Setting verson in Socialize.java to ${version}</echo>
<replaceregexp file="${tmp_dir}/sdk/src/com/socialize/Socialize.java" match="public\s+static\s+final\s+String\s+VERSION\s*=\s*".*"" replace="public static final String VERSION = "${version}"" />
<!-- Adjust project reference paths -->
<replaceregexp file="${tmp_dir}/sdk/project.properties" match="android.library.reference.1=../../facebook-android-sdk/facebook" replace="android.library.reference.1=../lib/facebook-android-sdk" byline="true"/>
<replaceregexp file="${tmp_dir}/sdk/project.properties" match="android.library.reference.2=../../android-ioc/core" replace="android.library.reference.2=../lib/android-ioc" byline="true"/>
<replaceregexp file="${tmp_dir}/sdk/project.properties" match="android.library.reference.3=../../loopy-sdk-android/sdk" replace="android.library.reference.3=../lib/loopy-sdk-android" byline="true"/>
<replaceregexp file="${tmp_dir}/demo/project.properties" match="android.library.reference.2=../../android-ioc/core" replace="android.library.reference.2=../lib/android-ioc" byline="true"/>
<replaceregexp file="${tmp_dir}/demo/project.properties" match="android.library.reference.3=../../facebook-android-sdk/facebook" replace="android.library.reference.3=../lib/facebook-android-sdk" byline="true"/>
<replaceregexp file="${tmp_dir}/demo/project.properties" match="android.library.reference.4=../../loopy-sdk-android/sdk" replace="android.library.reference.4=../lib/loopy-sdk-android" byline="true"/>
<!-- Create the ZIP file for distribution -->
<zip destfile="build/socialize-sdk-android-${version}.zip">
<zipfileset dir="icons" includes="**/*.psd" prefix="icons"/>
<!-- Add the sample app as a raw eclipse project -->
<zipfileset dir="${tmp_dir}/demo" prefix="demo" excludes="*.iml,gen/**,bin/**,build/**,codetemplates.xml,build-qa.xml,build-qa.properties,emma.properties,proguard.cfg,.DS_Store,assets/json/**,assets/socialize.sample.properties"/>
<zipfileset dir="${tmp_dir}/sdk" prefix="sdk" excludes="*.iml,gen/**,bin/**,build/**,codetemplates.xml,build-qa.xml,build-qa.properties,emma.properties,proguard.cfg,.DS_Store,assets/json/**,assets/socialize.sample.properties"/>
<zipfileset dir="${tmp_dir}/lib" prefix="lib" excludes="*.iml,gen/**,bin/**,build/**,codetemplates.xml,build-qa.xml,build-qa.properties,emma.properties,proguard.cfg,.DS_Store,assets/json/**,assets/socialize.sample.properties"/>
<!-- Add Docs -->
<zipfileset dir="build/docs" prefix="docs"/>
<zipfileset dir="build" includes="read_me_first.html,UPGRADING_README.txt"/>
</zip>
<!-- clean up -->
<delete dir="${tmp_dir}"/>
<delete dir="build/socialize-sdk-android-${version}"/>
<delete dir="build/docs"/>
<delete file="build/read_me_first.html"/>
<delete file="build/UPGRADING_README.txt"/>
</target>
</project>