Merge pull request #58 from MartinBalin/master

Meta information for VSNetBeans 13.0.301
diff --git a/jobs/netbeansnativelauncher.groovy b/jobs/netbeansnativelauncher.groovy
index 6142d9f..038bb8f 100644
--- a/jobs/netbeansnativelauncher.groovy
+++ b/jobs/netbeansnativelauncher.groovy
@@ -1,5 +1,4 @@
 #!groovy
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/jobs/netbeansreleasetlp.groovy b/jobs/netbeansreleasetlp.groovy
new file mode 100755
index 0000000..8884c9d
--- /dev/null
+++ b/jobs/netbeansreleasetlp.groovy
@@ -0,0 +1,77 @@
+#!groovy
+/*
+ * 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.
+ */
+organizationFolder('NetBeans/netbeans-TLP') {
+    description('Apache NetBeans release jobs and apidoc generation for historical version')
+    displayName('NetBeans-TLP')
+    
+    organizations {
+        configure {
+            def asf  = it / navigators / 'org.apache.jenkins.gitpubsub.ASFGitSCMNavigator'
+            asf << {
+                server ('https://gitbox.apache.org/repos/asf')
+            }
+            def traits = asf / traits
+            traits << 'org.apache.jenkins.gitpubsub.ASFMetadataSCMNavigatorTrait' {
+                avatarUrl('https://netbeans.apache.org/images/nblogo32x32.png')
+            }
+            traits << 'jenkins.scm.impl.trait.WildcardSCMSourceFilterTrait' {
+                includes('netbeans')
+            }
+            traits << 'jenkins.plugins.git.traits.BranchDiscoveryTrait' {}
+            traits << 'jenkins.scm.impl.trait.RegexSCMHeadFilterTrait' {
+                regex('(master|release\\d+$)')
+            }
+        }
+       
+        buildStrategies {
+            buildNamedBranches {
+                filters {
+                    regex {
+                        regex('(master|release\\d+$|vsnetbeans_preview_\\d+$))')
+                        caseSensitive(false)
+                    }
+                }
+            }
+        }
+        projectFactories {
+            workflowMultiBranchProjectFactory {
+                // Relative location within the checkout of our Pipeline script.
+                scriptPath("nbbuild/jenkins/Jenkinsfile.groovy")
+            } 
+        }
+        orphanedItemStrategy {
+            discardOldItems {
+                numToKeep(4)
+                daysToKeep(5)
+            }
+        }
+    
+        triggers {
+            periodicFolderTrigger {
+                interval("1d")
+            }
+        }
+    }
+}
+listView('NetBeans/netbeans') {
+    jobs {
+        name('NetBeans/netbeans-TLP')
+    }
+}
diff --git a/jobs/netbeanstestmatrix.groovy b/jobs/netbeanstestmatrix.groovy
index 36fc4c0..c326238 100644
--- a/jobs/netbeanstestmatrix.groovy
+++ b/jobs/netbeanstestmatrix.groovy
@@ -1,5 +1,4 @@
 #!groovy
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/vars/asfMainNetBeansBuild.groovy b/vars/asfMainNetBeansBuild.groovy
index c593a04..68acf50 100644
--- a/vars/asfMainNetBeansBuild.groovy
+++ b/vars/asfMainNetBeansBuild.groovy
@@ -47,6 +47,10 @@
 def tooling=[:]
 @groovy.transform.Field
 def repopluginversion="1.7-SNAPSHOT"
+@groovy.transform.Field
+def branch=""
+@groovy.transform.Field
+def heavyrelease=true
 
 def call(Map params = [:]) {
     // variable needed for apidoc
@@ -69,7 +73,7 @@
                         sh 'curl "https://gitbox.apache.org/repos/asf?p=netbeans-jenkins-lib.git;a=blob_plain;f=meta/netbeansrelease.json" -o netbeansrelease.json'
                         def releaseInformation = readJSON file: 'netbeansrelease.json'
                         sh 'rm -f netbeansrelease.json'
-                        def branch = env.BRANCH_NAME
+                        branch = env.BRANCH_NAME
                         def githash = env.GIT_COMMIT
 
                         println githash
@@ -77,9 +81,9 @@
 
                         if (!releaseInformation[branch]) {
                             // no branch definined in json exit build
-                            if (releaseInformation[branch.replace('vsnetbeans_previous_','release')]) {
+                            if (releaseInformation[branch.replace('vsnetbeans_preview_','release')]) {
                                 // branch is release1234
-                                branch = branch.replace('vsnetbeans_previous_','release')
+                                branch = branch.replace('vsnetbeans_preview_','release')
                             } else {
                                 // no branch definined in json exit build
                                 currentBuild.result = "FAILURE"
@@ -112,6 +116,8 @@
                         tooling.myMaven = releaseInformation[branch].maven
                         version = releaseInformation[branch].versionName;
                         vsixversion = releaseInformation[branch].vsixVersion;
+                        // make a new attribute in json for this.
+                        heavyrelease = releaseInformation[branch].publish_apidoc == 'true';
                         rmversion = version
                         //
                         if (releaseInformation[branch].milestones) {
@@ -186,8 +192,9 @@
                 }
                 when {
                     allOf {
-                        expression { BRANCH_NAME ==~ /release[0-9]+/ }
-                        //branch pattern : "release\\d+",comparator:"REGEXP" wait for modern 1.4.1
+                        //expression { BRANCH_NAME ==~ /release[0-9]+/ }
+                        branch pattern : "release\\d+",comparator:"REGEXP" 
+                        //wait for modern 1.4.1
                         expression { month !='Invalid'}
                     }
 
@@ -213,8 +220,9 @@
                 }
                 when {
                     allOf {
-                        expression { BRANCH_NAME ==~ /release[0-9]+/ }
-                        //branch pattern : "release\\d+",comparator:"REGEXP" wait for modern 1.4.1
+                        //expression { BRANCH_NAME ==~ /release[0-9]+/  || BRANCH_NAME ==~ /vsnetbeans_preview_[0-9]+/ }
+                        branch pattern : "release\\d+|vsnetbeans_preview_\\d+",comparator:"REGEXP" 
+                        //wait for modern 1.4.1
                         expression { month =='Invalid' }
                     }
                 }
@@ -270,7 +278,7 @@
         stage("prepare ${clustername}") {
             sh "rm -rf nbbuild/build"
 
-            sh "ant build-source-config -Dcluster.config=${clustername} -Dbuildnum=666"
+            sh "ant build-source-config -Dcluster.config=${clustername} -Dbuildnum=666 -Dmetabuild.branch=${branch}"
             script {
                 def targets = ['verify-libs-and-licenses','rat','build']
                 for (String target in targets) {
@@ -284,7 +292,7 @@
                         }
 
                         // build the target on the cluster defined common to all
-                        sh "ant -f ${target}-${clustername}-temp/build.xml ${target} -Dcluster.config=${clustername} ${add}"
+                        sh "ant -f ${target}-${clustername}-temp/build.xml ${target} -Dcluster.config=${clustername} ${add} -Dmetabuild.branch=${branch}"
 
                         // for verify-libs-and-licenses we only want the reports
                         if (target=='verify-libs-and-licenses') {
@@ -317,7 +325,7 @@
                                 sh "mkdir -p dist/installers"
                                 sh "mkdir -p distpreparation${versionnedpath}installer"
                                 sh "mkdir -p dist/vsix"
-
+                                if (heavyrelease) { // skip install for vscode
                                 def installer =  libraryResource 'org/apache/netbeans/installer.sh'
                                 writeFile file: "distpreparation${versionnedpath}installer/installer.sh", text: installer
 
@@ -343,35 +351,39 @@
                                 sh "cp distpreparation${versionnedpath}installer/dist/bundles/* dist/installers/ "
                                 sh "rm -rf distpreparation${versionnedpath}installer/dist"
                                 archiveArtifacts 'distpreparation/**'
-
+                                    
+                                } 
+                                
+                                
                                 // the installer phase is ok we should have installer for linux / windows + scripts and a bit of source to build macos later
 
 
                                 // additionnal target to have maven ready
                                 // javadoc build
-                                sh "ant -f build-${clustername}-temp/build.xml build-nbms build-source-zips generate-uc-catalog -Dcluster.config=release -Ddo.build.windows.launchers=true"
-                                sh "ant -f build-${clustername}-temp/build.xml build-javadoc -Djavadoc.web.root='${apidocurl}' -Dmodules-javadoc-date='${date}' -Datom-date='${atomdate}' -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"
+                                sh "ant -f build-${clustername}-temp/build.xml build-nbms build-source-zips generate-uc-catalog -Dcluster.config=release -Ddo.build.windows.launchers=true -Dmetabuild.branch=${branch}"
+                                sh "ant -f build-${clustername}-temp/build.xml build-javadoc -Djavadoc.web.root='${apidocurl}' -Dmodules-javadoc-date='${date}' -Datom-date='${atomdate}' -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip -Dmetabuild.branch=${branch}"
                                 sh "cp -r build-${clustername}-temp/nbbuild/nbms/** dist${versionnedpath}nbms/"
 
                                 archiveArtifacts 'WEBZIP.zip'
 
                                 def localRepo = ".repository"
                                 def netbeansbase = "build-${clustername}-temp/nbbuild"
-                                sh "ant -f build-${clustername}-temp/build.xml getallmavencoordinates"
-
+                                sh "ant -f build-${clustername}-temp/build.xml getallmavencoordinates -Dmetabuild.branch=${branch}"
                                 withMaven(maven:tooling.myMaven,jdk:tooling.jdktool,publisherStrategy: 'EXPLICIT',mavenLocalRepo: localRepo,options:[artifactsPublisher(disabled: true)])
                                 {
                                     sh "mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.1:get -Dartifact=org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion} -Dmaven.repo.local=${env.WORKSPACE}/.repository -DremoteRepositories=apache.snapshots.https::::https://repository.apache.org/snapshots"
                                     def commonparam = "-Dexternallist=${netbeansbase}/build/external.info"
                                     //sh "mvn org.apache.netbeans.utilities:nb-repository-plugin:1.5:download ${commonparam} -DrepositoryUrl=https://repo.maven.apache.org/maven2"
-                                    sh "mvn org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion}:populate ${commonparam} -DnetbeansNbmDirectory=${netbeansbase}/nbms -DnetbeansInstallDirectory=${netbeansbase}/netbeans -DnetbeansSourcesDirectory=${netbeansbase}/build/source-zips -DnetbeansJavadocDirectory=${netbeansbase}/build/javadoc -DparentGAV=org.apache.netbeans:netbeans-parent:2 -DforcedVersion=${mavenVersion} -DskipInstall=true -DdeployUrl=file://${env.WORKSPACE}/mavenrepository"
-                                    
+                                   if (heavyrelease) { // skip mavenrepo for vscode
+                                      sh "mvn org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion}:populate ${commonparam} -DnetbeansNbmDirectory=${netbeansbase}/nbms -DnetbeansInstallDirectory=${netbeansbase}/netbeans -DnetbeansSourcesDirectory=${netbeansbase}/build/source-zips -DnetbeansJavadocDirectory=${netbeansbase}/build/javadoc -DparentGAV=org.apache.netbeans:netbeans-parent:2 -DforcedVersion=${mavenVersion} -DskipInstall=true -DdeployUrl=file://${env.WORKSPACE}/mavenrepository"
+                                      archiveArtifacts 'mavenrepository/**'
+                                   }    
                                    // make vsix available to dist to pickup (only for main release) need a maven setup
-                                   sh "ant -f build-${clustername}-temp/java/java.lsp.server build-vscode-ext -Dvsix.version=${vsixversion}"
+                                   sh "ant -f build-${clustername}-temp/java/java.lsp.server build-vscode-ext -Dvsix.version=${vsixversion} -Dmetabuild.branch=${branch}"
                                    sh "cp -r build-${clustername}-temp/java/java.lsp.server/build/*.vsix dist/vsix/"
                                 }
-                                archiveArtifacts 'mavenrepository/**'
-
+                                
+                                
                                 
                             }