forked from hyphanet/fred
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
91 lines (75 loc) · 4.19 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="freenet-autodep" default="package" basedir=".">
<description>
Freenet is free software that lets you publish and retrieve information without
fear of censorship. To achieve this, the network is entirely decentralized, and
all actions are anonymous. Without anonymity, there can never be true freedom
of speech, and without decentralization the network would be vulnerable to attack.
This file is to build Freenet with minimal effort. It will check for Freenet's
dependencies and requirements, and will try to satisfy these if they are not
available (possibly using *pre-built blobs*).
</description>
<import file="build-clean.xml"/>
<property name="contrib.ant" value="${lib.contrib.dir}/../build.xml"/>
<property name="get.contrib.dir" value="https://downloads.freenetproject.org/latest"/>
<available property="contrib.present" file="${contrib.ant}"/>
<!-- =================================================================== -->
<!-- Dependencies (contrib, ie. freenet-ext.jar) -->
<!-- =================================================================== -->
<target name="-maybe-build-ext" if="contrib.present"><antcall target="build-ext"/></target>
<target name="-maybe-get-ext" unless="contrib.present"><antcall target="get-ext"/></target>
<target name="ensure-ext" depends="env" unless="lib.contrib.present"
description="try to ensure that Freenet-related dependencies are available">
<antcall target="-maybe-build-ext"/>
<antcall target="-maybe-get-ext"/>
</target>
<target name="warn-ext" unless="lib.contrib.get">
<echo>
freenet-ext does not appear to be available to the build process. We offer the
option of downloading it (as a binary), but currently this is an insecure
process and not recommended for the security conscious.
If you want to proceed with the download, please add "lib.contrib.get = true"
to the file override.properties (create it if it doesn't exist), and then run
me again. (This is the easier option, for newbies.)
If you want to build freenet-ext from source, please set "lib.contrib.dir"
instead - see build.properties for help on what values to use. You do not need
to build freenet-ext explicitly, I will do that automatically; but you need
ant-contrib installed for that to work.
Or you can manually put the jar in lib/freenet/freenet-ext.jar, if you want to
use an "official" version you have downloaded already.
For more options on how to tune the build process, see build.properties.
</echo>
<fail message="either set lib.contrib.get or lib.contrib.dir" />
</target>
<target name="get-ext" depends="warn-ext">
<get src="${get.contrib.dir}/freenet-ext.jar" dest="${lib.contrib.dir}/freenet-ext.jar"
usetimestamp="true" verbose="true"/>
<get src="${get.contrib.dir}/freenet-ext.jar.sha1" dest="${lib.contrib.dir}/freenet-ext.jar.sha1"
usetimestamp="true" verbose="true"/>
<checksum file="${lib.contrib.dir}/freenet-ext.jar" algorithm="sha1" pattern="{0} {1}"
verifyproperty="get.contrib.pass"/>
<fail unless="${get.contrib.pass}" message="checksum mismatch; please delete the files and try again"/>
</target>
<target name="build-ext">
<ant inheritAll="false" antfile="${contrib.ant}" />
</target>
<target name="clean-ext">
<ant inheritAll="false" antfile="${contrib.ant}" target="clean"/>
</target>
<!-- =================================================================== -->
<!-- Generate GWT code -->
<!-- =================================================================== -->
<target name="-maybe-build-gjs" if="gjs.lib.gwt.present"><antcall target="build-gjs"/></target>
<target name="-maybe-checkout-gjs" unless="gjs.lib.gwt.present"><antcall target="checkout-gjs"/></target>
<target name="ensure-gjs" depends="env-gjs" unless="gjs.present"
description="try to ensure that the GWT-generated javascript is available">
<antcall target="-maybe-build-gjs"/>
<antcall target="-maybe-checkout-gjs"/>
</target>
<target name="checkout-gjs" depends="clean-gjs" description="checkout pre-generated javascript from VCS">
<exec executable="git">
<arg value="checkout" />
<arg value="${gjs.dst}" />
</exec>
</target>
</project>