aboutsummaryrefslogtreecommitdiff
path: root/buildScripts
diff options
context:
space:
mode:
Diffstat (limited to 'buildScripts')
-rw-r--r--buildScripts/compile.ant.xml32
-rw-r--r--buildScripts/deps/findbugs.ant.xml79
2 files changed, 111 insertions, 0 deletions
diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml
index 49e3cdfa..880d7e16 100644
--- a/buildScripts/compile.ant.xml
+++ b/buildScripts/compile.ant.xml
@@ -48,12 +48,44 @@ lombok code including the various agents.
</fileset>
</path>
+ <path id="findbugs_deps.path">
+ <fileset dir="deps/buildScripts/findbugs">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+
<target name="-unpackLibs">
<unjar dest="build/lombok">
<path refid="libs.path" />
</unjar>
</target>
+ <target name="-check-findbugs">
+ <available property="findbugs.available" file="deps/buildScripts/findbugs/bin/findbugs" />
+ <fail unless="findbugs.available" message="You don't have findbugs available. Run 'ant installDeps' to fetch it." />
+ </target>
+
+ <target name="findbugs" depends="-check-findbugs, dist" description="Runs findbugs on the lombok sources">
+ <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs_deps.path" />
+ <mkdir dir="build/lombok_aux" />
+ <!-- This ridiculous waste of time (unpacking ALL deps, which is a lot of data!) is done because the ant findbugs task is
+ a retarded stepchild; it does not understand either pathrefs or wildcards (*.jar), and hardcoding the names of the various
+ eclipse module jars would be even worse. -->
+ <unjar dest="build/lombok_aux">
+ <fileset dir="deps/lombok">
+ <include name="**/*.jar" />
+ </fileset>
+ </unjar>
+
+ <findbugs home="deps/buildScripts/findBugs" output="html" outputFile="findbugsReport.html" jvmargs="-Xmx512m">
+ <auxClasspath path="build/lombok" />
+ <auxClasspath path="build/lombok_aux" />
+ <sourcePath path="src" />
+ <sourcePath path="src_eclipseagent" />
+ <class location="build/lombok/lombok" />
+ </findbugs>
+ </target>
+
<target name="compile" description="Compiles the code">
<mkdir dir="build/lombok" />
<!-- ant includes the destination dir on the classpath (and there are good reason to do this), but that also means
diff --git a/buildScripts/deps/findbugs.ant.xml b/buildScripts/deps/findbugs.ant.xml
new file mode 100644
index 00000000..6aeedb79
--- /dev/null
+++ b/buildScripts/deps/findbugs.ant.xml
@@ -0,0 +1,79 @@
+<!--
+ Copyright © 2009 Reinier Zwitserloot and Roel Spilker.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+-->
+<project name="lombok-deps-findbugs" basedir="../.." default="install">
+ <description>
+This buildfile is part of projectlombok.org. It responsible for finding, downloading, and updating findbugs.
+ </description>
+
+ <property name="findbugs.dir" location="deps/buildScripts/findbugs" />
+
+ <target name="-grab-findbugs-if-wanted" unless="findbugs.available" if="findbugs.grab">
+ <antcall target="-grab-findbugs" />
+ </target>
+
+ <target name="-grab-findbugs" unless="findbugs.available">
+ <mkdir dir="build/findbugs" />
+ <mkdir dir="${findbugs.dir}" />
+ <echo>Downloading findbugs v1.3.9 from sourceforge...</echo>
+ <get
+ src="http://mesh.dl.sourceforge.net/project/findbugs/findbugs/1.3.9/findbugs-1.3.9.tar.gz"
+ dest="build/findbugs/findbugs.tar.gz"
+ verbose="true" />
+ <untar src="build/findbugs/findbugs.tar.gz" compression="gzip" dest="${findbugs.dir}">
+ <mapper type="glob" from="findbugs-1.3.9/*" to="*" />
+ <patternset>
+ <exclude name="findbugs-1.3.9/doc" />
+ <exclude name="findbugs-1.3.9/doc/**" />
+ </patternset>
+ </untar>
+ </target>
+
+ <target name="-check-findbugs" unless="findbugs.available">
+ <available property="findbugs.available" file="${findbugs.dir}/bin/findbugs" />
+ </target>
+
+ <target name="install-silent" depends="-check-findbugs, -grab-findbugs">
+ <condition property="lombok.patcher.git.grab">
+ <not><isset property="lombok.patcher.available.git" /></not>
+ </condition>
+ <antcall target="-grab-git-lombok.patcher" />
+ <antcall target="-update-git-lombok.patcher" />
+ </target>
+
+ <target name="install" depends="-check-findbugs, -missing-findbugs" />
+
+ <target name="update" />
+ <target name="build" />
+
+ <target name="-missing-findbugs" unless="findbugs.available">
+ <input validArgs="s,S,skip,Skip,SKIP,g,d,D,download,Download,DOWNLOAD" addproperty="missing1.feedback">
+You don't have the findbugs dependency. If you want to run the 'ant findbugs' task to run findbugs on the lombok sources, you'll need it. Otherwise, you can skip it. If you want me to do so, I will download findbugs now and unpack it in the appropriate place (deps/buildScripts/findbugs). The file will be downloaded from sourceforge.
+ Pick one (first letter will do):
+ Skip - Skips this download. This dependency is optional.
+ Download - Grabs findbugs, so that you can run 'ant findbugs'.
+ </input>
+ <condition property="findbugs.grab">
+ <matches string="${missing1.feedback}" casesensitive="false" pattern="^d(ownload)?$" />
+ </condition>
+ <antcall target="-grab-findbugs-if-wanted" />
+ </target>
+</project>