This is an automated email from the ASF dual-hosted git repository.
skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans-tools.git
The following commit(s) were added to refs/heads/master by this push:
new 2d9c3a0 build file for apidoc and maven artefacts (#9)
2d9c3a0 is described below
commit 2d9c3a08dd433b61aeedf31eca7a6fefcb9ba035
Author: Eric Barboni <[email protected]>
AuthorDate: Thu Jan 10 09:48:44 2019 +0100
build file for apidoc and maven artefacts (#9)
create build file generator to help regenerating maven artefacts and apidoc
for release
instance for release for 9 and 10
---
.../conveniences/Jenkinsfile-master.groovy | 65 +++++++++++
.../conveniences/Jenkinsfile-release100.groovy | 65 +++++++++++
.../conveniences/Jenkinsfile-release90.groovy | 65 +++++++++++
buildscripts/conveniences/generatebuildscript.sh | 127 +++++++++++++++++++++
4 files changed, 322 insertions(+)
diff --git a/buildscripts/conveniences/Jenkinsfile-master.groovy
b/buildscripts/conveniences/Jenkinsfile-master.groovy
new file mode 100644
index 0000000..b8397c0
--- /dev/null
+++ b/buildscripts/conveniences/Jenkinsfile-master.groovy
@@ -0,0 +1,65 @@
+pipeline {
+ agent { label 'ubuntu' }
+ tools {
+ maven 'Maven 3.3.9'
+ jdk 'JDK 1.8 (latest)'
+ }
+ stages {
+ stage('Informations') {
+ steps {
+ echo "Branche we are building is : master"
+ }
+ }
+ stage('mavenutils preparation') {
+ // this stage is temporary
+ steps {
+ echo 'Get Mavenutils sources'
+ sh 'rm -rf mavenutils'
+ checkout([$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption',
noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion',
excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [],
userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans-mavenutils/']]])
+ script {
+ def mvnfoldersforsite =
['parent','nbm-shared','nb-repository-plugin']
+ for (String mvnproject in mvnfoldersforsite) {
+ dir('mavenutils/'+mvnproject) {
+ sh "mvn clean install
-Dmaven.repo.local=${env.WORKSPACE}/.repository"
+ }
+ }
+ }
+ }
+ }
+ stage('SCM operation') {
+ steps {
+ echo 'clean up netbeans sources'
+ sh 'rm -rf netbeanssources'
+ echo 'Get NetBeans sources'
+ checkout([$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption',
noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion',
excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']],
submoduleCfg: [], userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans/']]])
+ }
+ }
+ stage('NetBeans Builds') {
+ steps {
+ dir ('netbeanssources'){
+ withAnt(installation: 'Ant (latest)') {
+ sh 'ant'
+ sh "ant build-javadoc
-Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"
+ sh 'ant build-source-zips'
+ sh 'ant build-nbms'
+ }
+ }
+ archiveArtifacts 'WEBZIP.zip'
+ archiveArtifacts 'netbeanssources/nbbuild/netbeans/**'
+ archiveArtifacts 'netbeanssources/nbbuild/build/source-zips/**'
+ archiveArtifacts 'netbeanssources/nbbuild/build/javadoc/**'
+ archiveArtifacts 'netbeanssources/nbbuild/nbms/**'
+ }
+ }
+ stage('NetBeans Maven Stage') {
+ steps {
+ script {
+ sh "mvn
org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:download
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-Dmaven.repo.local=${env.WORKSPACE}/.repository
-DrepositoryUrl=https://repo.maven.apache.org/maven2"
+ sh 'mkdir -p testrepo/.m2'
+ sh "mvn
org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:populate
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-DnetbeansNbmDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/nbms
-DnetbeansInstallDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/netbeans
-DnetbeansSourcesDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/source-zips
-DnebeansJavadocDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/javadoc
-Dmaven.repo.local=${env.WORKSPACE} [...]
+ }
+ archiveArtifacts 'testrepo/.m2/**'
+ }
+ }
+ }
+}
diff --git a/buildscripts/conveniences/Jenkinsfile-release100.groovy
b/buildscripts/conveniences/Jenkinsfile-release100.groovy
new file mode 100644
index 0000000..4511229
--- /dev/null
+++ b/buildscripts/conveniences/Jenkinsfile-release100.groovy
@@ -0,0 +1,65 @@
+pipeline {
+ agent { label 'ubuntu' }
+ tools {
+ maven 'Maven 3.3.9'
+ jdk 'JDK 1.8 (latest)'
+ }
+ stages {
+ stage('Informations') {
+ steps {
+ echo "Branche we are building is : release100"
+ }
+ }
+ stage('mavenutils preparation') {
+ // this stage is temporary
+ steps {
+ echo 'Get Mavenutils sources'
+ sh 'rm -rf mavenutils'
+ checkout([$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption',
noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion',
excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [],
userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans-mavenutils/']]])
+ script {
+ def mvnfoldersforsite =
['parent','nbm-shared','nb-repository-plugin']
+ for (String mvnproject in mvnfoldersforsite) {
+ dir('mavenutils/'+mvnproject) {
+ sh "mvn clean install
-Dmaven.repo.local=${env.WORKSPACE}/.repository"
+ }
+ }
+ }
+ }
+ }
+ stage('SCM operation') {
+ steps {
+ echo 'clean up netbeans sources'
+ sh 'rm -rf netbeanssources'
+ echo 'Get NetBeans sources'
+ checkout([$class: 'GitSCM', branches: [[name: '*/release100']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption',
noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion',
excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']],
submoduleCfg: [], userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans/']]])
+ }
+ }
+ stage('NetBeans Builds') {
+ steps {
+ dir ('netbeanssources'){
+ withAnt(installation: 'Ant (latest)') {
+ sh 'ant'
+ sh "ant build-javadoc -Djavadoc.web.root='RELEASE100'
-Dmodules-javadoc-date='4 Dec 2018' -Datom-date='2018-12-04T12:00:00Z'
-Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"
+ sh 'ant build-source-zips'
+ sh 'ant build-nbms'
+ }
+ }
+ archiveArtifacts 'WEBZIP.zip'
+ archiveArtifacts 'netbeanssources/nbbuild/netbeans/**'
+ archiveArtifacts 'netbeanssources/nbbuild/build/source-zips/**'
+ archiveArtifacts 'netbeanssources/nbbuild/build/javadoc/**'
+ archiveArtifacts 'netbeanssources/nbbuild/nbms/**'
+ }
+ }
+ stage('NetBeans Maven Stage') {
+ steps {
+ script {
+ sh "mvn
org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:download
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-Dmaven.repo.local=${env.WORKSPACE}/.repository
-DrepositoryUrl=https://repo.maven.apache.org/maven2"
+ sh 'mkdir -p testrepo/.m2'
+ sh "mvn
org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:populate
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-DnetbeansNbmDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/nbms
-DnetbeansInstallDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/netbeans
-DnetbeansSourcesDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/source-zips
-DnebeansJavadocDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/javadoc
-Dmaven.repo.local=${env.WORKSPACE} [...]
+ }
+ archiveArtifacts 'testrepo/.m2/**'
+ }
+ }
+ }
+}
diff --git a/buildscripts/conveniences/Jenkinsfile-release90.groovy
b/buildscripts/conveniences/Jenkinsfile-release90.groovy
new file mode 100644
index 0000000..299b834
--- /dev/null
+++ b/buildscripts/conveniences/Jenkinsfile-release90.groovy
@@ -0,0 +1,65 @@
+pipeline {
+ agent { label 'ubuntu' }
+ tools {
+ maven 'Maven 3.3.9'
+ jdk 'JDK 1.8 (latest)'
+ }
+ stages {
+ stage('Informations') {
+ steps {
+ echo "Branche we are building is : release90"
+ }
+ }
+ stage('mavenutils preparation') {
+ // this stage is temporary
+ steps {
+ echo 'Get Mavenutils sources'
+ sh 'rm -rf mavenutils'
+ checkout([$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption',
noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion',
excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [],
userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans-mavenutils/']]])
+ script {
+ def mvnfoldersforsite =
['parent','nbm-shared','nb-repository-plugin']
+ for (String mvnproject in mvnfoldersforsite) {
+ dir('mavenutils/'+mvnproject) {
+ sh "mvn clean install
-Dmaven.repo.local=${env.WORKSPACE}/.repository"
+ }
+ }
+ }
+ }
+ }
+ stage('SCM operation') {
+ steps {
+ echo 'clean up netbeans sources'
+ sh 'rm -rf netbeanssources'
+ echo 'Get NetBeans sources'
+ checkout([$class: 'GitSCM', branches: [[name: '*/release90']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption',
noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion',
excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']],
submoduleCfg: [], userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans/']]])
+ }
+ }
+ stage('NetBeans Builds') {
+ steps {
+ dir ('netbeanssources'){
+ withAnt(installation: 'Ant (latest)') {
+ sh 'ant'
+ sh "ant build-javadoc -Djavadoc.web.root='RELEASE90'
-Dmodules-javadoc-date='29 Jul 2018' -Datom-date='2018-07-29T12:00:00Z'
-Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"
+ sh 'ant build-source-zips'
+ sh 'ant build-nbms'
+ }
+ }
+ archiveArtifacts 'WEBZIP.zip'
+ archiveArtifacts 'netbeanssources/nbbuild/netbeans/**'
+ archiveArtifacts 'netbeanssources/nbbuild/build/source-zips/**'
+ archiveArtifacts 'netbeanssources/nbbuild/build/javadoc/**'
+ archiveArtifacts 'netbeanssources/nbbuild/nbms/**'
+ }
+ }
+ stage('NetBeans Maven Stage') {
+ steps {
+ script {
+ sh "mvn
org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:download
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-Dmaven.repo.local=${env.WORKSPACE}/.repository
-DrepositoryUrl=https://repo.maven.apache.org/maven2"
+ sh 'mkdir -p testrepo/.m2'
+ sh "mvn
org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:populate
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-DnetbeansNbmDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/nbms
-DnetbeansInstallDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/netbeans
-DnetbeansSourcesDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/source-zips
-DnebeansJavadocDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/javadoc
-Dmaven.repo.local=${env.WORKSPACE} [...]
+ }
+ archiveArtifacts 'testrepo/.m2/**'
+ }
+ }
+ }
+}
diff --git a/buildscripts/conveniences/generatebuildscript.sh
b/buildscripts/conveniences/generatebuildscript.sh
new file mode 100644
index 0000000..be06e62
--- /dev/null
+++ b/buildscripts/conveniences/generatebuildscript.sh
@@ -0,0 +1,127 @@
+#!/usr/bin/python
+
+##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.
+
+import locale
+from datetime import datetime
+
+## tools needed
+maven339='Maven 3.3.9'
+jdk8='JDK 1.8 (latest)'
+ant10='Ant (latest)'
+
+## information for each release (tools + date of release to flag the doc)
+## pick tools that are available on ubuntu node on build.apache.org
+releaseinfo=[
+['release90', True,jdk8,maven339,ant10,'1.4-SNAPSHOT','RELEASE90',
'http://bits.netbeans.org/9.0/javadoc', datetime(2018,07,29,12,00)],
+['release100',True,jdk8,maven339,ant10,'1.4-SNAPSHOT','RELEASE100','http://bits.netbeans.org/10.0/javadoc',datetime(2018,12,
4,12,00)],
+##release 111
+['master',True,jdk8,maven339,ant10,'1.4-SNAPSHOT','dev-SNAPSHOT']] ## no need
custom info
+
+##for each release generate a
+for arelease in releaseinfo:
+ branch=arelease[0]
+ jdktool=arelease[2]
+ maventool=arelease[3]
+ anttool=arelease[4]
+ tmpFile1 = open ('Jenkinsfile-'+branch+'.groovy',"w")
+ tmpFile1.write("pipeline {\n")
+ tmpFile1.write(" agent { label 'ubuntu' }\n")
+ tmpFile1.write(" tools {\n")
+ tmpFile1.write(" maven '"+maventool+"'\n")
+ tmpFile1.write(" jdk '"+jdktool+"'\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" stages {\n")
+ tmpFile1.write(" stage('Informations') {\n")
+ tmpFile1.write(" steps {\n")
+ tmpFile1.write(" echo "+'"'+'Branche we are building is :
'+branch+'"'+"\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+## needed until we had mavenutil ready
+##prepare nb-repository from master to populate
+ if arelease[1] == True:
+ tmpFile1.write(" stage('mavenutils preparation') {\n")
+ tmpFile1.write(" // this stage is temporary\n")
+ tmpFile1.write(" steps {\n")
+ tmpFile1.write(" echo 'Get Mavenutils sources'\n")
+ tmpFile1.write(" sh 'rm -rf mavenutils'\n")
+ tmpFile1.write(" checkout([$class: 'GitSCM', branches:
[[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions:
[[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class:
'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [],
userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans-mavenutils/']]])\n")
+ tmpFile1.write(" script {\n")
+ tmpFile1.write(" def mvnfoldersforsite =
['parent','nbm-shared','nb-repository-plugin']\n");
+ tmpFile1.write(" for (String mvnproject in
mvnfoldersforsite) {\n")
+ tmpFile1.write(" dir('mavenutils/'+mvnproject) {\n")
+ tmpFile1.write(" sh "+'"'+'mvn clean install
-Dmaven.repo.local=${env.WORKSPACE}/.repository'+'"'+"\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+
+ tmpFile1.write(" stage('SCM operation') {\n")
+ tmpFile1.write(" steps {\n")
+ tmpFile1.write(" echo 'clean up netbeans sources'\n")
+ tmpFile1.write(" sh 'rm -rf netbeanssources'\n")
+ tmpFile1.write(" echo 'Get NetBeans sources'\n")
+ tmpFile1.write(" checkout([$class: 'GitSCM', branches: [[name:
'*/"+branch+"']], doGenerateSubmoduleConfigurations: false, extensions:
[[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class:
'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class:
'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']],
submoduleCfg: [], userRemoteConfigs: [[url:
'https://github.com/apache/incubator-netbeans/']]])\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+## build netbeans all needed for javadoc and nb-repository plugin
+ tmpFile1.write(" stage('NetBeans Builds') {\n")
+ tmpFile1.write(" steps {\n")
+ tmpFile1.write(" dir ('netbeanssources'){\n")
+ tmpFile1.write(" withAnt(installation: '"+anttool+"') {\n")
+ tmpFile1.write(" sh 'ant'\n")
+## master use default parameter
+ if branch=='master':
+ tmpFile1.write(" sh "+'"'+"ant build-javadoc
-Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"+'"'+"\n")
+ else:
+ locale.setlocale(locale.LC_ALL,"en_US.utf8")
+##URL for javadoc
+ javadocwebroot = arelease[6]
+##date for javadoc and for feed
+ javadocdate = arelease[8].strftime('%-d %b %Y')
+ atomdate = arelease[8].strftime('%Y-%m-%dT%H:%M:%SZ')
+ tmpFile1.write(" sh "+'"'+"ant build-javadoc
-Djavadoc.web.root='"+javadocwebroot+"'
-Dmodules-javadoc-date='"+javadocdate+"' -Datom-date='"+atomdate+"'
-Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"+'"'+"\n")
+ tmpFile1.write(" sh 'ant build-source-zips'\n")
+ tmpFile1.write(" sh 'ant build-nbms'\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" archiveArtifacts 'WEBZIP.zip'\n")
+ tmpFile1.write(" archiveArtifacts
'netbeanssources/nbbuild/netbeans/**'\n")
+ tmpFile1.write(" archiveArtifacts
'netbeanssources/nbbuild/build/source-zips/**'\n")
+ tmpFile1.write(" archiveArtifacts
'netbeanssources/nbbuild/build/javadoc/**'\n")
+ tmpFile1.write(" archiveArtifacts
'netbeanssources/nbbuild/nbms/**'\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+#prepare maven artifacts
+ tmpFile1.write(" stage('NetBeans Maven Stage') {\n")
+ tmpFile1.write(" steps {\n")
+ tmpFile1.write(" script {\n")
+ nbbuildpath = "${env.WORKSPACE}/netbeanssources/nbbuild"
+ tmpFile1.write(" sh "+'"'+'mvn
org.netbeans.maven:nb-repository-plugin:'+arelease[5]+':download
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-Dmaven.repo.local=${env.WORKSPACE}/.repository'+ '
-DrepositoryUrl=https://repo.maven.apache.org/maven2"'+"\n")
+ tmpFile1.write(" sh 'mkdir -p testrepo/.m2'\n")
+ tmpFile1.write(" sh "+'"'+'mvn
org.netbeans.maven:nb-repository-plugin:'+arelease[5]+':populate
-DnexusIndexDirectory=${env.WORKSPACE}/repoindex
-DnetbeansNbmDirectory='+nbbuildpath+'/nbms
-DnetbeansInstallDirectory='+nbbuildpath+'/netbeans
-DnetbeansSourcesDirectory='+nbbuildpath+'/build/source-zips
-DnebeansJavadocDirectory='+nbbuildpath+'/build/javadoc
-Dmaven.repo.local=${env.WORKSPACE}/.repository -DforcedVersion='+arelease[6]+'
-DskipInstall=true -DdeployU [...]
+)
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" archiveArtifacts 'testrepo/.m2/**'\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write(" }\n")
+ tmpFile1.write("}\n")
+ tmpFile1.close
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists