Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
cbe5e10b
Commit
cbe5e10b
authored
12 years ago
by
Rich Lane
Browse files
Options
Downloads
Patches
Plain Diff
add optional ant targets to generate thrift code
parent
78bffca2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.xml
+46
-10
46 additions, 10 deletions
build.xml
with
46 additions
and
10 deletions
build.xml
+
46
−
10
View file @
cbe5e10b
...
...
@@ -19,6 +19,13 @@
limitations under the License.
-->
<!--
The build uses pregenerated Thrift code by default to reduce build
dependencies. To generate it locally run ant with
-Dthrift.out.dir=target/gen-java. If you change the Thrift files be
sure to also commit the updated generated code.
-->
<project
default=
"dist"
name=
"Floodlight"
>
<property
name=
"target"
location=
"target"
/>
<property
name=
"build"
location=
"${target}/bin"
/>
...
...
@@ -32,11 +39,13 @@
<property
name=
"python-src"
location=
"src/main/python"
/>
<property
name=
"docs"
location=
"${target}/docs"
/>
<property
name=
"main-class"
value=
"net.floodlightcontroller.core.Main"
/>
<property
name=
"packetstreamer-gen"
location=
"lib/gen-java"
/>
<property
name=
"packetstreamer-gen-build"
location=
"lib/gen-java-bin"
/>
<property
name=
"packetstreamer-thrift-jar"
value=
"packetstreamer-thrift.jar"
/>
<property
name=
"floodlight-jar"
location=
"${target}/floodlight.jar"
/>
<property
name=
"floodlight-test-jar"
location=
"${target}/floodlight-test.jar"
/>
<property
name=
"thrift.dir"
value=
"${basedir}/src/main/thrift"
/>
<property
name=
"thrift.out.dir"
value=
"lib/gen-java"
/>
<property
name=
"thrift.bin.dir"
value=
"${target}/gen-java-bin"
/>
<property
name=
"thrift.package"
value=
"net/floodlightcontroller/packetstreamer/thrift"
/>
<property
name=
"ant.build.javac.source"
value=
"1.6"
/>
<property
name=
"ant.build.javac.target"
value=
"1.6"
/>
<property
name=
"lib"
location=
"lib"
/>
...
...
@@ -104,7 +113,8 @@
<mkdir
dir=
"${build}"
/>
<mkdir
dir=
"${build-test}"
/>
<mkdir
dir=
"${target}/lib"
/>
<mkdir
dir=
"${packetstreamer-gen-build}"
/>
<mkdir
dir=
"${thrift.out.dir}"
/>
<mkdir
dir=
"${thrift.bin.dir}"
/>
<mkdir
dir=
"${test-output}"
/>
</target>
...
...
@@ -112,7 +122,7 @@
<javac
includeAntRuntime=
"false"
classpathref=
"classpath"
debug=
"true"
srcdir=
"${source}:${
packetstreamer-gen
}"
srcdir=
"${source}:${
thrift.bin.dir
}"
destdir=
"${build}"
>
</javac>
</target>
...
...
@@ -127,22 +137,48 @@
destdir=
"${build-test}"
/>
</target>
<target
name=
"compile-thrift"
depends=
"init"
>
<javac
srcdir=
"${packetstreamer-gen}"
<!-- Thrift build based on http://www.flester.com/blog/2009/04/26/using-thrift-from-ant -->
<fileset
id=
"thrift.files"
dir=
"${thrift.dir}"
>
<include
name=
"**/*.thrift"
/>
</fileset>
<!-- Determine if thrift generated java is up to date -->
<!-- Removes generated code if the thrift files changed -->
<target
name=
"thrift-deps"
depends=
"init"
>
<dependset>
<srcfileset
refid=
"thrift.files"
/>
<targetfileset
dir =
"${thrift.out.dir}/${thrift.package}"
>
<include
name=
"**/*.java"
/>
</targetfileset>
</dependset>
<available
file=
"${thrift.out.dir}/${thrift.package}/Message.java"
property=
"thrift.uptodate"
/>
</target>
<target
name=
"gen-thrift"
depends=
"thrift-deps,init"
unless=
"thrift.uptodate"
>
<pathconvert
property=
"thrift.file.list"
refid=
"thrift.files"
pathsep=
" "
dirsep=
"/"
>
</pathconvert>
<echo
message=
"Running thrift generator on ${thrift.file.list}"
/>
<exec
executable=
"thrift"
dir=
"${basedir}"
failonerror=
"true"
>
<arg
line=
"--strict -v --gen java -o ${thrift.out.dir}/.. ${thrift.file.list}"
/>
</exec>
</target>
<target
name=
"compile-thrift"
depends=
"init,gen-thrift"
>
<javac
srcdir=
"${thrift.out.dir}"
includeantruntime=
"false"
destdir=
"${
packetstreamer-gen-build
}"
destdir=
"${
thrift.bin.dir
}"
debug=
"true"
debuglevel=
"lines,vars,source"
classpathref=
"classpath"
/>
</target>
<target
name=
"packetstreamer-thrift"
depends=
"compile-thrift"
>
<jar
jarfile=
"${target}/lib/${packetstreamer-thrift-jar}"
basedir=
"${
packetstreamer-gen-build
}"
/>
basedir=
"${
thrift.bin.dir
}"
/>
</target>
<target
name=
"clean"
>
<delete
dir=
"${target}"
/>
<delete
dir=
"${packetstreamer-gen-build}"
/>
<delete
file=
"${target}/lib/${packetstreamer-thrift-jar}"
/>
</target>
<target
name=
"run"
depends=
"dist"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment