Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
141 lines (110 sloc) 5.86 KB
<project name="Idea Google Go language scripted build file" default="assemble" basedir=".">
<!-- 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="${dist}/idea-IC-107.SNAPSHOT/"/>
<property name="go.sdk.build" location="${user.home}/Tools/google-go/release/"/>
<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="(&lt;key&gt;idea.platform.prefix&lt;/key&gt;[\r\n \t]+&lt;string&gt;)Idea(&lt;/string&gt;)"
replace="\1GoIde\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(&lt;key&gt;idea.paths.selector&lt;/key&gt;[\r\n \t]+&lt;string&gt;)[^&lt;]+(&lt;/string&gt;)"
replace="\1.GoIde1\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(&lt;key&gt;CFBundleName&lt;/key&gt;[\r\n \t]+&lt;string&gt;)[^&lt;]+(&lt;/string&gt;)"
replace="\1Go Ide\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(&lt;key&gt;CFBundleIdentifier&lt;/key&gt;[\r\n \t]+&lt;string&gt;)[^&lt;]+(&lt;/string&gt;)"
replace="\1ro.redeul.google.go.ide\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(&lt;key&gt;CFBundleGetInfoString&lt;/key&gt;[\r\n \t]+&lt;string&gt;)[^&lt;]+(&lt;/string&gt;)"
replace="\1GoIde 1.0.0, build 0.4.2\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(&lt;key&gt;CFBundleShortVersionString&lt;/key&gt;[\r\n \t]+&lt;string&gt;)[^&lt;]+(&lt;/string&gt;)"
replace="\11.0.0\2"
/>
<replaceregexp
file="${idea.community.build}/Contents/Info.plist"
byline="false"
match="(&lt;key&gt;CFBundleVersion&lt;/key&gt;[\r\n \t]+&lt;string&gt;)[^&lt;]+(&lt;/string&gt;)"
replace="\11.0.0 (0.4.2)\2"
/>
</target>
<target name="assemble" depends="clean,init,resources,fix.Info.plist" description="compile the source">
<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"/>
<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}" prefix="go-ide/bundled/go-sdk" includes="bin/**/*" filemode="755"/>
<zipfileset dir="${go.sdk.build}"
prefix="go-ide/bundled/go-sdk"
includes="doc/**/*,include/**/*,src/**/*,*"
excludes="**/*.o,**/*.a,**/*.so"
/>
<zipfileset dir="${go.sdk.build}"
prefix="go-ide/bundled/go-sdk"
includes="pkg/**/*"
/>
</zip>
</target>
<target name="clean" description="clean up">
<delete file="${go.ide.target.package}.zip"/>
</target>
</project>