blob: fd80860ec56d44b9a45e15daa1a6d1a3c3bc2846 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="cmdline" basedir=".">
<description>Builds the module suite cmdline.</description>
<condition property="nbplatform.default.netbeans.dest.dir" value="${NETBEANS_PLATFORM}">
<isset property="NETBEANS_PLATFORM" />
</condition>
<condition property="nbplatform.default.harness.dir" value="${NETBEANS_PLATFORM}/harness">
<isset property="NETBEANS_PLATFORM" />
</condition>
<import file="nbproject/build-impl.xml"/>
<!-- <import file="../suite-common.xml"/>-->
<!-- copied (and adjusted) from suite.xml: -->
<target name="test" depends="build" description="Runs tests for all modules in the suite.">
<sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.test.sorted" sorttests="true"/>
<subant target="test" buildpath="${modules.test.sorted}" inheritrefs="false" inheritall="false">
<property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
<property name="harness.taskdefs.done" value="${harness.taskdefs.done}"/> <!-- optimization -->
</subant>
</target>
<target name="build-source-dist">
<mkdir dir="build" />
<zip file="build/apache-netbeans-jackpot-${version}.zip">
<zipfileset dir="." excludes="**/build/" prefix="jackpot"/>
<zipfileset dir=".." includes="LICENSE" fullpath="jackpot/LICENSE"/>
<zipfileset dir=".." includes="NOTICE" fullpath="jackpot/NOTICE"/>
</zip>
</target>
<target name="build-and-test">
<property name="version" value="11.1" />
<condition property="jackpot.root" value="${basedir}" else="${basedir}/..">
<available file="${basedir}/LICENSE" />
</condition>
<ant dir="${basedir}" inheritAll="false" inheritRefs="false">
<property name="nbplatform.default.harness.dir" value="${NETBEANS_PLATFORM}/harness" />
<property name="nbplatform.default.netbeans.dest.dir" value="${NETBEANS_PLATFORM}" />
<property name="test.run.args" value="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" />
<property name="test.nbjdk.home" value="${JDK11}" />
<property name="jackpot.root" location="${jackpot.root}" />
<target name="clean" />
<target name="build" />
<target name="test" />
</ant>
<ant dir="${basedir}/tool" target="create-standalone-tool" inheritAll="false" inheritRefs="false">
<property name="nbplatform.default.harness.dir" value="${NETBEANS_PLATFORM}/harness" />
<property name="nbplatform.default.netbeans.dest.dir" value="${NETBEANS_PLATFORM}" />
<property name="continue.after.failing.tests" value="false" />
<property name="test.run.args" value="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" />
<property name="test.nbjdk.home" value="${JDK11}" />
<property name="jackpot.root" location="${jackpot.root}" />
</ant>
<property environment="env"/>
<exec executable="build/test/scripted/run" dir="tool" failonerror="true">
<env key="JAVA_HOME" path="${JDK11}" />
<env key="PATH" path="${JDK11}/bin:${env.PATH}" />
</exec>
<echo>Installing tool to the local maven repository:</echo>
<exec dir="." executable="mvn" failonerror="true">
<arg line="install:install-file -Dfile=tool/build/jackpot/jackpot.jar -DgroupId=org.apache.netbeans.modules.jackpot30 -DartifactId=tool -Dversion=${version} -Dpackaging=jar -DpomFile=tool/scripts/pom.xml" />
</exec>
<echo>Building maven plugin:</echo>
<exec dir="maven" executable="mvn" failonerror="true">
<arg line="-Dversion=${version} install -DskipTests" />
</exec>
<echo>Run plugin tests:</echo>
<exec dir="maven" executable="mvn" failonerror="true">
<env key="JAVA_HOME" path="${JDK11}" />
<arg line="-Dmaven.executable=mvn -Djackpot.plugin.version=${version} test" />
</exec>
<property name="build.maven.repo" location="build/.m2" />
<mkdir dir="${build.maven.repo}" />
<echo>Installing tool to the target maven repository:</echo>
<exec dir="maven" executable="mvn" failonerror="true">
<arg line="deploy:deploy-file -Dfile=${basedir}/tool/build/jackpot/jackpot.jar -Djavadoc=${basedir}/tool/build/jackpot-javadoc.zip -Dsources=${basedir}/tool/build/jackpot-sources.zip -DgroupId=org.apache.netbeans.modules.jackpot30 -DartifactId=tool -Dversion=${version} -Dpackaging=jar -DgeneratePom=true -DaltDeploymentRepository=temp::default::file://${build.maven.repo} -Durl=file://${build.maven.repo}" />
</exec>
<echo>Installing plugin to the target maven repository:</echo>
<exec dir="maven" executable="mvn" failonerror="true">
<arg line="-DskipTests -DaltDeploymentRepository=temp::default::file://${build.maven.repo} deploy" />
</exec>
<zip destfile="build/.m2.zip">
<zipfileset dir="${build.maven.repo}/" />
<zipfileset dir="tool/scripts" includes="LICENSE-bin-tool.txt" fullpath="LICENSE" />
<zipfileset dir="tool/scripts" includes="NOTICE-bin-tool.txt" fullpath="NOTICE" />
</zip>
</target>
<target name="rat">
<mkdir dir="build" />
<get src="https://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat/0.12/apache-rat-0.12.jar"
dest="build/apache-rat-0.12.jar"
skipexisting="true" />
<taskdef uri="antlib:org.apache.rat.anttasks" resource="org/apache/rat/anttasks/antlib.xml">
<classpath>
<pathelement location="build/apache-rat-0.12.jar"/>
</classpath>
</taskdef>
<fileset dir="${basedir}" id="rat.files">
<excludesfile name="rat-exclusions.txt" />
</fileset>
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks" reportfile="build/rat-report.txt">
<rat:fullTextMatcher licenseFamilyCategory="AL" licenseFamilyName="Apache License 2.0 Short header">
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements; and to You under the Apache License, Version 2.0.
</rat:fullTextMatcher>
<rat:approvedLicense familyName="Apache License 2.0 Short header"/>
<resources refid="rat.files" />
</rat:report>
<resourcecount property="rat.content.elements">
<fileset file="build/rat-report.txt">
<and>
<contains text="Binaries: 0" />
<contains text="Archives: 0" />
<contains text="0 Unknown Licenses" />
</and>
</fileset>
</resourcecount>
<condition property="rat.failed">
<not>
<equals arg1="${rat.content.elements}" arg2="1" />
</not>
</condition>
<fail if="${rat.failed}">RAT failed.</fail>
</target>
</project>