This repository was archived by the owner on May 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsdk_annotations.xml
More file actions
156 lines (135 loc) · 7.4 KB
/
Copy pathsdk_annotations.xml
File metadata and controls
156 lines (135 loc) · 7.4 KB
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
<project name="Build SDK (JDK/ANDROID) Annotations" default="build_all">
<property file="manifest.properties" />
<property name="build.number" value="@snapshot@"/>
<property name="kannotator-cli-jar" value="${basedir}/out/artifacts/KAnnotatorCli/kannotator.jar"/>
<property name="android.studio.zip.src.url"
value="http://dl.google.com/dl/android/studio/ide-zips/0.4.5/android-studio-ide-133.1021040-linux.zip"/>
<property name="android.studio.download.dir"
value="${basedir}/dependencies/download"/>
<property name="android.studio.zip"
value="${android.studio.download.dir}/android-studio-ide.zip"/>
<property name="android.studio.annotations.jar"
value="${android.studio.download.dir}/androidAnnotations.jar"/>
<property name="android.studio.annotations.dir"
value="${basedir}/android-sdk-annotations-adt"/>
<property name="jdk.annotations.inferred.dir"
value="jdk-annotations-inferred"/>
<property name="android.sdk.annotations.inferred.dir"
value="android-sdk-annotations-inferred"/>
<target name="build_all" depends="build_jdk_annotations,build_android_annotations"/>
<target name="build_jdk_annotations">
<build_sdk_annotations
lib.jar="lib/jdk/jre-7u12-windows-rt.jar"
customization.dir="jdk-custom"
xml.annotations.out.dir="${jdk.annotations.inferred.dir}"
jaif.name="kotlin-jdk-annotations"
annotations.jar="out/artifacts/annotations/kotlin-jdk-annotations.jar"
implementation.title="${manifest.impl.title.kotlin.compiler.annotations.jdk}"
postprocess.inferred="postprocess_jdk_annotations" />
</target>
<target name="postprocess_jdk_annotations">
<copy todir="${jdk.annotations.inferred.dir}">
<fileset dir="jdk-custom/postprocess" includes="sun/**/*"/>
</copy>
<loadfile property="java.util.patch"
srcFile="jdk-custom/postprocess/java/util/annotations.xml"/>
<replace file="${jdk.annotations.inferred.dir}/java/util/annotations.xml" value="${java.util.patch}">
<replacetoken><![CDATA[</root>]]></replacetoken>
</replace>
<loadfile property="java.awt.patch"
srcFile="jdk-custom/postprocess/java/awt/annotations.xml"/>
<replace file="${jdk.annotations.inferred.dir}/java/awt/annotations.xml" value="${java.awt.patch}">
<replacetoken><![CDATA[</root>]]></replacetoken>
</replace>
<loadfile property="java.util.concurrent.patch"
srcFile="jdk-custom/postprocess/java/util/concurrent/annotations.xml"/>
<replace file="${jdk.annotations.inferred.dir}/java/util/concurrent/annotations.xml" value="${java.util.concurrent.patch}">
<replacetoken><![CDATA[</root>]]></replacetoken>
</replace>
<loadfile property="javax.swing.patch"
srcFile="jdk-custom/postprocess/javax/swing/annotations.xml"/>
<replace file="${jdk.annotations.inferred.dir}/javax/swing/annotations.xml" value="${javax.swing.patch}">
<replacetoken><![CDATA[</root>]]></replacetoken>
</replace>
</target>
<target name="build_android_annotations" depends="download_android_studio_annotations">
<build_sdk_annotations
lib.jar="android-custom/android-sdk_4.4.2.jar"
customization.dir="android-custom"
xml.annotations.out.dir="${android.sdk.annotations.inferred.dir}"
xml.annotations.pack.dir="android-sdk-annotations-combined"
jaif.name="kotlin-android-sdk-annotations"
annotations.jar="out/artifacts/annotations/kotlin-android-sdk-annotations.jar"
implementation.title="${manifest.impl.title.kotlin.compiler.annotations.android}"
postprocess.inferred="postprocess_android_annotations" />
</target>
<target name="postprocess_android_annotations">
<loadfile property="android.view.patch"
srcFile="android-custom/postprocess/android/view/annotations.xml"/>
<replace file="${android.sdk.annotations.inferred.dir}/android/view/annotations.xml" value="${android.view.patch}">
<replacetoken><![CDATA[</root>]]></replacetoken>
</replace>
<java
classname="org.jetbrains.kannotator.client.androidCombine.AndroidCombinePackage"
fork="true"
maxmemory="1024m">
<classpath>
<pathelement location="${kannotator-cli-jar}"/>
</classpath>
</java>
</target>
<macrodef name="build_sdk_annotations">
<attribute name="lib.jar"/>
<attribute name="customization.dir"/>
<attribute name="xml.annotations.out.dir"/>
<attribute name="xml.annotations.pack.dir" default="@{xml.annotations.out.dir}"/>
<attribute name="jaif.name"/>
<attribute name="annotations.jar"/>
<attribute name="implementation.title"/>
<attribute name="postprocess.inferred"/>
<attribute name="previous.jaif" default="commandLineClient/inferred/@{jaif.name}.jaif"/>
<attribute name="current.jaif" default="out/artifacts/annotations/@{jaif.name}.jaif"/>
<sequential>
<java
classname="org.jetbrains.kannotator.client.sdk.SdkPackage"
fork="true"
maxmemory="1024m">
<arg value="@{lib.jar}"/>
<arg value="@{customization.dir}"/>
<arg value="@{xml.annotations.out.dir}"/>
<arg value="@{jaif.name}"/>
<classpath>
<pathelement location="${kannotator-cli-jar}"/>
</classpath>
</java>
<echo message="comparing @{previous.jaif} and @{current.jaif}"/>
<condition property="jaif-identical">
<filesmatch textfile="true"
file1="@{previous.jaif}"
file2="@{current.jaif}" />
</condition>
<fail unless="jaif-identical"
message="@{previous.jaif} and @{current.jaif} are different"/>
<antcall target="@{postprocess.inferred}" />
<jar destfile="@{annotations.jar}" basedir="@{xml.annotations.pack.dir}">
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="@{implementation.title}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
</sequential>
</macrodef>
<target name="download_android_studio_annotations">
<mkdir dir="${android.studio.download.dir}"/>
<get src="${android.studio.zip.src.url}" dest="${android.studio.zip}" usetimestamp="true"/>
<unzip src="${android.studio.zip}" dest="${android.studio.download.dir}">
<patternset>
<include name="android-studio/plugins/android/lib/androidAnnotations.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<unjar src="${android.studio.annotations.jar}" dest="${android.studio.annotations.dir}"/>
</target>
</project>