-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
160 lines (115 loc) · 6.38 KB
/
build.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
<?xml version="1.0" encoding="UTF-8"?>
<!-- requires: (1) ant4eclipse installed as an eclipse plugin; (2) ant-contrib installed; (3) jarsigner.exe be on the path -->
<project name="simpl_translators" default="build_compilers">
<!-- declare ant4eclipse -->
<taskdef resource="org/ant4eclipse/antlib.xml">
<classpath>
<pathelement location="${basedir}/../ecologylabFundamental/lib/org.ant4eclipse_1931.jar" />
<pathelement location="${basedir}/../ecologylabFundamental/lib/ecj-3.6.jar" />
<pathelement location="${basedir}/../ecologylabFundamental/lib/org.eclipse.osgi_3.6.0.v20100517.jar" />
</classpath>
</taskdef>
<!-- workspace directory -->
<property name="workspace.dir" value="${basedir}/.." />
<property name="repository.dir" value="${workspace.dir}/../MetaMetadataRepository" />
<property name="deploy.dir" value="${repository.dir}" />
<property name="jar_file.csharp" value="${deploy.dir}/MetaMetadataCompilerForCSharp.jar" />
<property name="jar_file.java" value="${deploy.dir}/MetaMetadataCompilerForJava.jar" />
<!-- configure eclipse -->
<target name="configure.eclipse" if="eclipse.running">
<echo message="Configuring compiler for Eclipse..."/>
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
<!-- targets -->
<target name="clean">
<delete file="$jar_file.java" />
<delete file="$jar_file.csharp" />
</target>
<target name="compile-translators">
</target>
<target name="compile-project">
<echo>compiling project ${project.name} ...</echo>
<getJdtSourcePath property="projectSourcePath" workspaceDirectory="${basedir}/.." projectName="${project.name}" allowMultipleFolders="true" />
<getJdtOutputPath property="projectOutputPath" workspaceDirectory="${basedir}/.." projectName="${project.name}" />
<getJdtClassPath pathId="projectClassPath" workspaceDirectory="${basedir}/.." projectName="${project.name}" />
<javac classpathref="projectClassPath" srcdir="${projectSourcePath}" destdir="${projectOutputPath}" excludes="**/standalone/**, **/deprecated/**" />
</target>
<target name="build-jars">
<!-- Get the build order for your projects according to their deps -->
<getBuildOrder buildOrderProperty="buildorder" teamProjectSet="${project.set}" workspaceDirectory="${workspace.dir}" />
<echo>List of projects to build: ${buildorder}</echo>
<!-- Build all projects (invoke 'build-project'-target for each project) -->
<foreach list="${buildorder}" target="jar-library" param="project.name" trim="yes" />
</target>
<target name="build_compilers">
<!-- <antcall target="configure.eclipse"/> -->
<antcall target="clean"/>
<antcall target="build-jars"/>
<antcall target="sign-jars"/>
</target>
<target name="clean_generated_semantics_java">
<delete>
<fileset dir="${workspace.dir}/ecologylabGeneratedSemantics/src" includes="**/*.java" />
<fileset dir="${workspace.dir}/ecologylabSemantics/src/ecologylab/semantics/metadata/builtins/declarations" includes="**/*Declaration.java" />
</delete>
</target>
<target name="refresh_generated_semantics_java">
<eclipse.refreshLocal resource="ecologylabGeneratedSemantics/src" depth="infinite" />
<eclipse.refreshLocal resource="ecologylabSemantics/src/ecologylab/semantics/metadata/builtins/declarations" depth="infinite" />
</target>
<target name="compile_meta_metadata_to_java">
<antcall target="compile-project">
<param name="project.name" value="simplTranslators" />
</antcall>
<antcall target="clean_generated_semantics_java" />
<getJdtClassPath pathId="simplTranslators.classpath" workspaceDirectory="${workspace.dir}" projectName="simplTranslators" />
<java classpathref="simplTranslators.classpath" classname="ecologylab.semantics.compiler.NewMetaMetadataCompiler" fork="true">
<jvmarg line="-ea" />
<arg line="java ../ecologylabGeneratedSemantics/src ../ecologylabSemantics/src" />
</java>
<antcall target="refresh_generated_semantics_java" />
</target>
<target name="clean_generated_semantics_csharp">
</target>
<target name="compile_meta_metadata_to_csharp">
</target>
<taskdef name="antform" classname="com.sardak.antform.AntForm" classpath="${basedir}/../ecologylabFundamental/lib/antform.jar"/>
<!-- optional: declare ant-contrib -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${basedir}/../ecologylabFundamental/lib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<jdtClassPathLibrary name="org.eclipse.jdt.junit.JUNIT_CONTAINER/4">
<fileset file="${basedir}/../ecologylabFundamental/lib/org.eclipse.osgi_3.5.2.R35x_v20100126.jar"/>
</jdtClassPathLibrary>
<target name="build-library">
<echo>building project ${project.name}</echo>
<!-- Get the sourcepath of your project -->
<getJdtSourcePath property="mySourcepath" workspaceDirectory="${basedir}/.." projectName="${project.name}" />
<!-- Get the outputpath of your project -->
<getJdtOutputPath property="myOutputpath" workspaceDirectory="${basedir}/.." projectName="${project.name}" />
<!-- Get classpath of your project -->
<getJdtClassPath pathId="myClasspath" workspaceDirectory="${basedir}/.." projectName="${project.name}" />
<!-- compile your project with the settings from Eclipse -->
<javac classpathref="myClasspath" srcdir="${mySourcepath}" destdir="${myOutputpath}"
excludes="**/standalone/**, **/deprecated/**"/>
</target>
<!-- Jar a library and store it in dynlib.dir -->
<target name="jar-library" depends="build-library">
<echo>Jar'ing project ${project.name} from ${myOutputpath}</echo>
<!-- Get the outputpath of your project -->
<getJdtOutputPath property="myOutputpath" workspaceDirectory="${workspace.dir}" projectName="${project.name}" />
<jar destfile="${dynlib.dir}/${project.name}${app.version}.jar" basedir="${myOutputpath}"
includes="**/*.class, **/*.properties"
excludes="**/standalone/**, **/deprecated/**"/>
</target>
<!-- signs all jars copied to the study -->
<target name="sign-jars">
<signjar alias="Interface Ecology Lab" storepass="ecologylab" keypass="ecology" keystore="${basedir}/../cf/chain" preservelastmodified="true">
<path>
<fileset dir="${dynlib.dir}" includes="**/*.jar" />
</path>
</signjar>
</target>
</project>