This repository has been archived by the owner on May 25, 2023. It is now read-only.
forked from go-lang-plugin-org/go-lang-idea-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-distribution.xml
161 lines (127 loc) · 6.49 KB
/
build-distribution.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
<project name="Idea Google Go language scripted build file" default="assemble"
basedir=".">
<property file="build.properties" />
<!-- set global properties for this build -->
<property name="work" location="build"/>
<property name="dist" location="dist"/>
<property name="go.plugin" value="${dist}/ro.redeul.google.go.jar"/>
<property name="idea.community.build"
location="idea-home/idea-IC-107.SNAPSHOT/"/>
<property name="go.sdk.build"
location="idea-home/go/"/>
<property name="target.platform" value="current"/>
<property name="go.ide.target.package"
value="${dist}/go-ide-${target.platform}.zip"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<!--<mkdir dir="${target.root}" />-->
<echo message="Assembling Go-Ide into archive: ${go.ide.target.package}"/>
<condition property="is.darwin">
<equals arg1="${target.platform}" arg2="darwin"/>
</condition>
</target>
<target name="resources" depends="init"
description="Builds the GoIde resources jar">
<echo message="Using Idea Community build from: ${idea.community.build}"/>
<jar destfile="${dist}/goide-resources.jar">
<fileset dir="${basedir}/go-ide/resources" includes="**/*.*"/>
<zipfileset src="${idea.community.build}/lib/resources.jar"
includes="idea/IdeaActions.xml"
fullpath="idea/GoIdeActions.xml"/>
<zipfileset src="${idea.community.build}/lib/resources.jar"
includes="META-INF/IdeaPlugin.xml"
fullpath="META-INF/GoIdePlugin.xml"/>
</jar>
</target>
<target name="fix.Info.plist" depends="init" if="is.darwin">
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(<key>idea.popup.weight</key>[\r\n \t]+<string>[^<]+</string>)"
replace="\1${line.separator}${line.separator} <key>idea.platform.prefix</key>${line.separator} <string>GoIde</string>"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(<key>idea.paths.selector</key>[\r\n \t]+<string>)[^<]+(</string>)"
replace="\1.GoIde1\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(<key>CFBundleName</key>[\r\n \t]+<string>)[^<]+(</string>)"
replace="\1Go Ide\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(<key>CFBundleIdentifier</key>[\r\n \t]+<string>)[^<]+(</string>)"
replace="\1ro.redeul.google.go.ide\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(<key>CFBundleGetInfoString</key>[\r\n \t]+<string>)[^<]+(</string>)"
replace="\1GoIde 1.5.0, build 0.9.0\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(<key>CFBundleShortVersionString</key>[\r\n \t]+<string>)[^<]+(</string>)"
replace="\11.5.0\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(<key>CFBundleVersion</key>[\r\n \t]+<string>)[^<]+(</string>)"
replace="\11.5.0 (0.9.0)\2"
/>
</target>
<target name="fix.idea.properties" depends="init" unless="is.darwin">
<concat destfile="${work}/idea.properties" force="true">
<fileset dir="${idea.community.build}/bin"
includes="idea.properties"/>
<footer trimleading="yes">idea.platform.prefix=GoIde</footer>
</concat>
<replaceregexp
file="${work}/idea.properties"
byline="true"
match="^(?:# )?idea.(config|system|plugins|log).path=([^/]+)/\.[^/]+/(config|system)"
replace="idea.\1.path=\2/.GoIde1/\3"/>
</target>
<target name="assemble" depends="clean,init,resources,fix.idea.properties,fix.Info.plist"
description="compile the source">
<fixcrlf srcdir="${idea.community.build}/bin" includes="*.bat"
eol="dos"/>
<zip file="${go.ide.target.package}" preserve0permissions="true">
<zipfileset dir="${idea.community.build}" prefix="go-ide"
includes="**/*"
excludes="bin/*.sh,bin/fsnotifier*,bin/idea.properties,bin/*.exe"/>
<zipfileset file="${work}/idea.properties" prefix="go-ide/bin"/>
<zipfileset dir="${idea.community.build}" prefix="go-ide"
includes="bin/*.sh,bin/fsnotifier*,bin/*.exe"
filemode="755"/>
<zipfileset file="${go.plugin}"
prefix="go-ide/plugins/ro.redeul.google.go/lib/"/>
<zipfileset file="${dist}/goide-resources.jar"
prefix="go-ide/lib/"/>
<zipfileset dir="${go.sdk.build}" includes="bin/**/*" filemode="755"
prefix="go-ide/bundled/go-sdk"/>
<zipfileset dir="${go.sdk.build}"
includes="doc/**/*,include/**/*,src/**/*,*"
excludes="**/*.o,**/*.a,**/*.so"
prefix="go-ide/bundled/go-sdk"/>
<zipfileset dir="${go.sdk.build}" includes="pkg/**/*"
excludes="pkg/tool/*"
prefix="go-ide/bundled/go-sdk"/>
<zipfileset dir="${go.sdk.build}" includes="pkg/tool/*"
filemode="755"
prefix="go-ide/bundled/go-sdk"/>
</zip>
</target>
<target name="clean" description="clean up">
<delete file="${go.ide.target.package}.zip"/>
</target>
</project>