All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uy.fb-delta.fb-delta.0.2.0.source-code.build.xml Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
<!-- fb-delta Ant build script. Dave Brosius -->

<project name="fb-delta" default="default">

	<presetdef name="javac">
		<javac encoding="UTF-8" />
	</presetdef>

	<presetdef name="javadoc">
		<javadoc encoding="UTF-8" />
	</presetdef>
	
    <property file="user.properties" />
    <property file="build.properties" />
    <property file="version.properties" />

	<property name="src.dir" value="${basedir}/src" />
	<property name="lib.dir" value="${basedir}/lib" />
	<property name="target.dir" value="${basedir}/target" />
	<property name="classes.dir" value="${target.dir}/classes" />
	<property name="javadoc.dir" value="${target.dir}/javadoc" />
	<property name="javac.source" value="1.7" />
	<property name="javac.target" value="1.7" />
	<property name="javac.deprecation" value="on" />
	<property name="javac.debug" value="on" />

	<property name="fb-delta.version" value="0.2.0" />
	
	<property name="sonatype.dir" value="${user.home}/.fb-delta-${fb-delta.version}-sonatype" />
	
	<target name="clean" description="removes all generated collateral">
		<delete dir="${target.dir}" />
	</target>
	
	<target name="infra_jars" description="pull jars needed to build fb-delta to ${user.dir}/.ant/lib">
		<mkdir dir="${user.home}/.ant/lib" />
		<get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.4.0/yank-1.4.0.jar" dest="${user.home}/.ant/lib"/>
		<get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/>
	</target>
	
	<target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank">
        <mkdir dir="${lib.dir}" />
        <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true" separateClassifierTypes="true">
            <server url="http://repo1.maven.org/maven2" />
            <generateVersions propertyFileName="${basedir}/version.properties" />
        </yank:yank>
    </target>
    
    <target name="info">
        <echo message="fb-delta - a findbugs results deltaing tool"/>
        <echo message=""/>
    	<echo message="    This project requires two jar to build fb-delta: yank and vcsversion" />
    	<echo message=""/>
        <echo message="    This project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/>
        <echo message="    download yank.jar and place in ~/.ant/lib directory"/>
        <echo message="    http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.mebigfatguy.yank%22"/>
        
    	<echo message="===="/>

    	<echo message="    Finally, this project uses vcsversion to inject the git version information into the manifest file"/>
    	<echo message="    and can be downloaded and placed in ~/.ant/lib as well"/>
    	<echo message="    http://search.maven.org/#search%7Cga%7C1%7Cvcsversion"/>
        <echo message="===="/>
    	<echo message="    This task can be automated by running ant infra_jars"/>
    </target>
	
	<target name="default" depends="info, build"/>

	<target name="-init" depends="yank">
		<mkdir dir="${lib.dir}" />
		<mkdir dir="${classes.dir}" />
		<mkdir dir="${javadoc.dir}" />
		<path id="fb-delta.classpath">
			<pathelement location="${lib.dir}/ant-${ant_.version}.jar" />
		</path>
	</target>

	<target name="compile" depends="-init" description="compiles java files">
		<javac srcdir="${src.dir}" destdir="${classes.dir}" source="${javac.source}" target="${javac.target}" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
			<classpath refid="fb-delta.classpath" />
		</javac>
		<copy tofile="${classes.dir}/com/mebigfatguy/fbdelta/antlib.xml" file="${src.dir}/com/mebigfatguy/fbdelta/antlib.xml" />
	</target>

	<target name="jar" depends="compile" xmlns:vcs="antlib:com.mebigfatguy.vcsversion" description="produces the fb-delta jar file">
		<vcs:vcsversion vcs="git" revisionProperty="_rev_" dateProperty="_date_" branchProperty="_branch_" urlProperty="_url_"/>
		<jar destfile="${target.dir}/fb-delta-${fb-delta.version}.jar">
			<fileset dir="${classes.dir}">
				<include name="**/*.class" />
				<include name="**/*.xml" />
			</fileset>
			<fileset dir="${basedir}">
				<include name="license.txt" />
			</fileset>
			<manifest>
				<attribute name="fb-delta-version" value="${fb-delta.version}" />
				<attribute name="Main-Class" value="com.mebigfatguy.fbdelta.FBDeltaTask" />
				<attribute name="git-url" value="${_url_}" />
				<attribute name="git-branch" value="${_branch_}" />
				<attribute name="git-revision" value="${_rev_}" />
				<attribute name="git-date" value="${_date_}" />
				<attribute name="Bundle-ManifestVersion" value="2" />
				<attribute name="Bundle-Name" value="fb-delta ant task" />
				<attribute name="Bundle-SymbolicName" value="fb-delta; singleton:=true" />
				<attribute name="Bundle-Version" value="${fb-delta.version}" />
				<attribute name="Bundle-ClassPath" value="." />
				<attribute name="Bundle-Vendor" value="FBDelta Project" />
				<attribute name="Bundle-ActivationPolicy" value="lazy" />
				<attribute name="Export-Package" value="com.mebigfatguy.fbdelta" />
                <attribute name="Import-Package" value="" />
			</manifest>
		</jar>
	</target>

	<target name="srczip" description="builds the source distribution zip file">
		<zip destfile="${target.dir}/fb-delta-${fb-delta.version}-sources.jar">
			<fileset dir="${basedir}">
				<include name="**/*.java" />
				<include name="**/*.license" />
                <include name="**/*.md" />
                <include name="**/*.xml" />
                <include name="**/*.properties" />
			</fileset>
		</zip>
	</target>

	<target name="javadoc" depends="-init" description="build the javadoc for the project">
		<javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-delta.classpath" destdir="${javadoc.dir}" windowtitle="fb-delta api">
			<doctitle><![CDATA[<h1>fb-delta javadoc</h1>]]></doctitle>
			<bottom><![CDATA[<i>Copyright &#169; 2016 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
		</javadoc>
	</target>

	<target name="build" depends="clean, -init, compile, jar" description="builds the ant task jar"/>

	<target name="release" depends="build, srczip, javadoc" description="prepares everything for a release" />

    <target name="sonatype" depends="release" description="prepare an artifact bundle for sonatype">
        <mkdir dir="${sonatype.dir}"/>
        <copy todir="${sonatype.dir}" file="${target.dir}/fb-delta-${fb-delta.version}.jar"/>
        <copy todir="${sonatype.dir}" file="${target.dir}/fb-delta-${fb-delta.version}-sources.jar"/>
        <jar destfile="${sonatype.dir}/fb-delta-${fb-delta.version}-javadoc.jar" basedir="${target.dir}" includes="javadoc/**"/>
        <copy tofile="${sonatype.dir}/fb-delta-${fb-delta.version}.pom" file="${basedir}/pom.xml"/>
        
        <exec executable="gpg">
            <arg value="-abi" />
            <arg value="${sonatype.dir}/fb-delta-${fb-delta.version}.jar" />
        </exec>
        <exec executable="gpg">
            <arg value="-abi" />
            <arg value="${sonatype.dir}/fb-delta-${fb-delta.version}.pom" />
        </exec>
        <exec executable="gpg">
            <arg value="-abi" />
            <arg value="${sonatype.dir}/fb-delta-${fb-delta.version}-sources.jar" />
        </exec>        
        <exec executable="gpg">
            <arg value="-abi" />
            <arg value="${sonatype.dir}/fb-delta-${fb-delta.version}-javadoc.jar" />
        </exec>
        <jar destfile="${sonatype.dir}/bundle.jar" basedir="${sonatype.dir}" includes="fb-delta*">
        </jar>
        <echo message="" />
        <echo message="" />
        <echo message="====================================================================================================================================" />
        <echo message="sonatype update bundle produced at ${sonatype.dir}/bundle.jar" />
        <echo message="upload this jar at https://oss.sonatype.org" />
        <echo message="" />
        <echo message="see link for details-> https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+The+Central+Repository" />
        <echo message="====================================================================================================================================" />
    </target>
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy