mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
initial build script
This commit is contained in:
parent
468f099417
commit
4ad800e2e1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
build/
|
#build/
|
||||||
test-results/
|
test-results/
|
||||||
*.csproj.user
|
*.csproj.user
|
||||||
*.suo
|
*.suo
|
||||||
|
16
CSharpTranslator/antlr3/build/build.properties
Normal file
16
CSharpTranslator/antlr3/build/build.properties
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
project.dir=../
|
||||||
|
builder.ant.lib=${project.dir}/buildjar
|
||||||
|
build.dir=${project.dir}/Builds
|
||||||
|
|
||||||
|
release.branch=trialcs2j
|
||||||
|
|
||||||
|
cs2j.version=not.official.release
|
||||||
|
cs2j.src.dir=${project.dir}/src
|
||||||
|
cs2j.parser.dir=${cs2j.src.dir}/CSharpParser
|
||||||
|
cs2j.transform.dir=${project.dir}/CS2JTranslator/CS2JTransform
|
||||||
|
cs2j.sln=${cs2j.src.dir}/CS2JTranslator.sln
|
||||||
|
|
||||||
|
win.net.number=v4.0.30319
|
||||||
|
win.msbuild.dir=/WINDOWS/Microsoft.NET/Framework/${win.net.number}
|
||||||
|
win.msbuild.exe=${win.msbuild.dir}/msbuild.exe
|
||||||
|
other.msbuild.exe=xbuild
|
125
CSharpTranslator/antlr3/build/build.xml
Normal file
125
CSharpTranslator/antlr3/build/build.xml
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
<project name="CS2JDist" default="release" basedir=".">
|
||||||
|
|
||||||
|
<description>
|
||||||
|
This build file builds a cs2j distribution archive
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<property file="${user.home}/${ant.project.name}.build.properties"/>
|
||||||
|
<property file="${user.home}/build.properties"/>
|
||||||
|
<property file="local.build.properties"/>
|
||||||
|
<property file="build.properties"/>
|
||||||
|
|
||||||
|
<!-- load the ant-antlr task -->
|
||||||
|
<taskdef resource="org/apache/tools/ant/antlr/antlib.xml" classpath="${builder.ant.lib}/ant-antlr3.jar;${project.dir}/jar/antlr-3.3.jar" />
|
||||||
|
|
||||||
|
<!-- git macros, stolen / based on http://tlrobinson.net/blog/2008/11/13/ant-tasks-for-git/ -->
|
||||||
|
<macrodef name = "git">
|
||||||
|
<attribute name = "command" />
|
||||||
|
<attribute name = "dir" default = "" />
|
||||||
|
<attribute name = "failonerror" default = "false" />
|
||||||
|
<attribute name = "gitresult" default = "gitresult" />
|
||||||
|
<attribute name = "gitresultsetonfail" default = "@{gitresult}.setonfail" />
|
||||||
|
<element name = "args" optional = "true" />
|
||||||
|
<sequential>
|
||||||
|
<echo message = "git @{command}" />
|
||||||
|
<exec executable = "git" dir = "@{dir}" failonerror="@{failonerror}" resultproperty = "@{gitresult}">
|
||||||
|
<arg value = "@{command}" />
|
||||||
|
<args/>
|
||||||
|
</exec>
|
||||||
|
<condition property="@{gitresultsetonfail}">
|
||||||
|
<equals arg1="${@{gitresult}}" arg2="1"/>
|
||||||
|
</condition>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
|
<macrodef name = "git-clone-pull">
|
||||||
|
<attribute name = "repository" />
|
||||||
|
<attribute name = "dest" />
|
||||||
|
<sequential>
|
||||||
|
<git command = "clone">
|
||||||
|
<args>
|
||||||
|
<arg value = "@{repository}" />
|
||||||
|
<arg value = "@{dest}" />
|
||||||
|
</args>
|
||||||
|
</git>
|
||||||
|
<git command = "pull" dir = "@{dest}" />
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
|
<target name="release" description="make a release archive" depends="clean,init,switch,buildgrammarfiles,buildapplication"/>
|
||||||
|
|
||||||
|
<target name="buildcs2j" description="builds cs2j and other utilities">
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="buildgrammarfiles" description="invokes ANTLR to convert grammar files to C# source">
|
||||||
|
<ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr" verbose="true"
|
||||||
|
target="${cs2j.parser.dir}/cs.g"
|
||||||
|
make="true" />
|
||||||
|
<ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr" verbose="true"
|
||||||
|
target="${cs2j.transform.dir}/TemplateExtracter.g"
|
||||||
|
libdirectory="${cs2j.parser.dir}"
|
||||||
|
make="true" />
|
||||||
|
<ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr" verbose="true"
|
||||||
|
target="${cs2j.transform.dir}/JavaMaker.g"
|
||||||
|
libdirectory="${cs2j.parser.dir}"
|
||||||
|
make="true" />
|
||||||
|
<ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr" verbose="true"
|
||||||
|
target="${cs2j.transform.dir}/NetMaker.g"
|
||||||
|
libdirectory="${cs2j.parser.dir}"
|
||||||
|
make="true" />
|
||||||
|
<ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr" verbose="true"
|
||||||
|
target="${cs2j.transform.dir}/JavaPrettyPrint.g"
|
||||||
|
libdirectory="${cs2j.parser.dir}"
|
||||||
|
make="true" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<target name="buildapplication" description="builds all C# source in the solution">
|
||||||
|
<exec osfamily="windows" executable="${win.msbuild.exe}">
|
||||||
|
<arg value = "${cs2j.sln}"/>
|
||||||
|
<arg value = "/t:Clean"/>
|
||||||
|
</exec>
|
||||||
|
<exec osfamily="windows" executable="${win.msbuild.exe}">
|
||||||
|
<arg value = "${cs2j.sln}"/>
|
||||||
|
<arg value = "/t:Build"/>
|
||||||
|
</exec>
|
||||||
|
<exec osfamily="mac" executable="${other.msbuild.exe}">
|
||||||
|
<arg value = "${cs2j.sln}"/>
|
||||||
|
<arg value = "/t:Clean"/>
|
||||||
|
</exec>
|
||||||
|
<exec osfamily="mac" executable="${other.msbuild.exe}">
|
||||||
|
<arg value = "${cs2j.sln}"/>
|
||||||
|
<arg value = "/t:Build"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="switch" description="switched to release branch and checks that the working copy is all committed">
|
||||||
|
<git command = "checkout" failonerror="true">
|
||||||
|
<args>
|
||||||
|
<arg value = "--quiet"/>
|
||||||
|
<arg value = "${release.branch}"/>
|
||||||
|
</args>
|
||||||
|
</git>
|
||||||
|
<git command = "diff-index" gitresult = "local.wc.isdirty">
|
||||||
|
<args>
|
||||||
|
<arg value = "--quiet"/>
|
||||||
|
<arg value = "HEAD"/>
|
||||||
|
</args>
|
||||||
|
</git>
|
||||||
|
<fail message = "Working Copy is dirty. Commit changes and try again." if="local.wc.isdirty.setonfail" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="init" depends="">
|
||||||
|
<mkdir dir="${build.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="clean" depends="" description="Clean build directory">
|
||||||
|
<delete failonerror="false" dir="${build.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="dumpProperties" description="output all set properties, a useful sanity check">
|
||||||
|
<echoproperties/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
BIN
CSharpTranslator/antlr3/buildjar/ant-antlr3.jar
Executable file
BIN
CSharpTranslator/antlr3/buildjar/ant-antlr3.jar
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user