|
2 | 2 | <!-- You may freely edit this file. See harness/README in the NetBeans platform --> |
3 | 3 | <!-- for some information on what you could do (e.g. targets to override). --> |
4 | 4 | <!-- If you delete this file and reopen the project it will be recreated. --> |
5 | | -<project name="org.netbeans.modules.php.phpcsfixer" default="netbeans" basedir="."> |
| 5 | +<project name="org.netbeans.modules.php.phpcsfixer" default="netbeans" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
6 | 6 | <description>Builds, tests, and runs the project org.netbeans.modules.php.phpcsfixer.</description> |
7 | 7 | <import file="nbproject/build-impl.xml"/> |
| 8 | + |
| 9 | + <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" /> |
| 10 | + <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" /> |
| 11 | + |
| 12 | + <!-- define Maven coordinates --> |
| 13 | + <property name="groupId" value="com.junichi11.netbeans.modules" /> |
| 14 | + <property name="artifactId" value="netbeans-php-cs-fixer" /> |
| 15 | + <!-- also change the version of pom.xml --> |
| 16 | + <property name="version" value="0.10.1" /> |
| 17 | + <!-- defined maven snapshots and staging repository id and url --> |
| 18 | + <property name="ossrh-snapshots-repository-url" |
| 19 | + value="https://oss.sonatype.org/content/repositories/snapshots/" /> |
| 20 | + <property name="ossrh-staging-repository-url" |
| 21 | + value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" /> |
| 22 | + <!-- there server id in the Maven settings.xml --> |
| 23 | + <property name="ossrh-server-id" value="ossrh" /> |
| 24 | + <property name="build" value="build" /> |
| 25 | + <property name="code-name-base" value="org-netbeans-modules-php-phpcsfixer" /> |
| 26 | + |
| 27 | + <target name="update-version-number"> |
| 28 | + <replaceregexp file="pom.xml" |
| 29 | + match="(^ <version>).+(</version>)" |
| 30 | + replace="\1${version}\2" |
| 31 | + byline="true" /> |
| 32 | + <replaceregexp file="manifest.mf" |
| 33 | + match="(OpenIDE-Module-Specification-Version:[ ]*).+" |
| 34 | + replace="\1${version}" |
| 35 | + byline="true" /> |
| 36 | + </target> |
| 37 | + |
| 38 | + <target name="deploy" depends="update-version-number,nbm" description="deploy release version to Maven repository"> |
| 39 | + <move file="${build}/${code-name-base}.nbm" toFile="${build}/${artifactId}-${version}.nbm"/> |
| 40 | + <artifact:mvn> |
| 41 | + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> |
| 42 | + <arg value="-Durl=${ossrh-staging-repository-url}" /> |
| 43 | + <arg value="-DrepositoryId=${ossrh-server-id}" /> |
| 44 | + <arg value="-DpomFile=pom.xml" /> |
| 45 | + <arg value="-Dfile=${build}/${artifactId}-${version}.nbm" /> |
| 46 | + <arg value="-Pgpg" /> |
| 47 | + </artifact:mvn> |
| 48 | + </target> |
8 | 49 | </project> |
0 commit comments