forked from tntim96/JSCover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-maven.xml
52 lines (46 loc) · 2.81 KB
/
build-maven.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
<project name="maven" basedir=".">
<property file="build.properties" />
<property file="src/main/resources/jscover/configuration.properties" />
<property name="groupId" value="com.github.tntim96"/>
<property name="artifactId" value="JSCover"/>
<property name="version" value="${version}"/>
<!-- define artifacts' name, which follows the convention of Maven -->
<property name="mavenBundleDir" value="${build.dir}/mavenBundle"/>
<property name="maven-jar" value="${mavenBundleDir}/${ant.project.name}-${version}.jar"/>
<property name="maven-javadoc-jar" value="${mavenBundleDir}/${ant.project.name}-${version}-javadoc.jar"/>
<property name="maven-sources-jar" value="${mavenBundleDir}/${ant.project.name}-${version}-sources.jar"/>
<!-- defined maven snapshots and staging repository id and url -->
<property name="maven-snapshots-repository-id" value="sonatype-nexus-snapshots"/>
<property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/"/>
<property name="maven-staging-repository-id" value="sonatype-nexus-staging"/>
<property name="maven-staging-repository-url"
value="https://oss.sonatype.org/service/local/staging/deploy/maven2/"/>
<target name="generate-files" depends="jar" description="Maven Step 1 - Create files to be signed">
<mkdir dir="${mavenBundleDir}/javadoc"/>
<copy file="pom.xml" tofile="${mavenBundleDir}/${ant.project.name}-${version}.pom"/>
<copy file="${dist.dir}/${ant.project.name}.jar"
tofile="${mavenBundleDir}/${ant.project.name}-${version}.jar"/>
<jar jarfile="${mavenBundleDir}/${ant.project.name}-${version}-sources.jar" basedir="${src.main.dir}"
compress="false"/>
<javadoc destdir="${mavenBundleDir}/javadoc"
version="true"
use="true"
windowtitle="${ant.project.name} API">
<classpath refid="compile.classpath"/>
<packageset dir="${src.main.dir}" defaultexcludes="yes">
<include name="jscover/**"/>
</packageset>
<doctitle><![CDATA[<h1>${ant.project.name}</h1>]]></doctitle>
</javadoc>
<jar jarfile="${mavenBundleDir}/${ant.project.name}-${version}-javadoc.jar" basedir="${mavenBundleDir}/javadoc"
compress="false"/>
<delete dir="${mavenBundleDir}/javadoc"/>
<!-- Automate signing -->
</target>
<target name="maven-bundle" description="Maven Step 2 - Bundle files after saving">
<!-- Add dependency when signing automated -->
<property name="mavenBundleDir" value="${build.dir}/mavenBundle"/>
<jar jarfile="${dist.dir}/${ant.project.name}-${version}-bundle.jar" basedir="${mavenBundleDir}"
compress="true"/>
</target>
</project>