|
| 1 | +name: $(Date:yyyyMMdd).$(Rev:r) |
| 2 | +variables: |
| 3 | + - name: Codeql.Enabled |
| 4 | + value: true |
| 5 | +resources: |
| 6 | + repositories: |
| 7 | + - repository: self |
| 8 | + type: git |
| 9 | + ref: refs/heads/main |
| 10 | + - repository: 1esPipelines |
| 11 | + type: git |
| 12 | + name: 1ESPipelineTemplates/1ESPipelineTemplates |
| 13 | + ref: refs/tags/release |
| 14 | +trigger: none |
| 15 | +extends: |
| 16 | + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines |
| 17 | + parameters: |
| 18 | + pool: |
| 19 | + os: linux |
| 20 | + name: 1ES_JavaTooling_Pool |
| 21 | + image: 1ES_JavaTooling_Ubuntu-2004 |
| 22 | + sdl: |
| 23 | + sourceAnalysisPool: |
| 24 | + name: 1ES_JavaTooling_Pool |
| 25 | + image: 1ES_JavaTooling_Windows_2022 |
| 26 | + os: windows |
| 27 | + customBuildTags: |
| 28 | + - MigrationTooling-mseng-VSJava-9151-Tool |
| 29 | + stages: |
| 30 | + - stage: Build |
| 31 | + jobs: |
| 32 | + - job: Job_1 |
| 33 | + displayName: Sign-Jars-RC |
| 34 | + templateContext: |
| 35 | + outputs: |
| 36 | + - output: pipelineArtifact |
| 37 | + artifactName: m2 |
| 38 | + targetPath: $(Build.ArtifactStagingDirectory)/m2 |
| 39 | + displayName: "Publish Artifact: m2" |
| 40 | + - output: pipelineArtifact |
| 41 | + artifactName: p2 |
| 42 | + targetPath: $(Build.ArtifactStagingDirectory)/p2 |
| 43 | + displayName: "Publish Artifact: p2" |
| 44 | + steps: |
| 45 | + - checkout: self |
| 46 | + fetchTags: true |
| 47 | + - task: JavaToolInstaller@0 |
| 48 | + displayName: Use Java 17 |
| 49 | + inputs: |
| 50 | + versionSpec: "17" |
| 51 | + jdkArchitectureOption: x64 |
| 52 | + jdkSourceOption: PreInstalled |
| 53 | + - task: CmdLine@2 |
| 54 | + displayName: Parse the release version from pom.xml |
| 55 | + inputs: |
| 56 | + script: |- |
| 57 | + #!/bin/bash |
| 58 | +
|
| 59 | + sudo apt-get install xmlstarlet |
| 60 | + xmlstarlet --version |
| 61 | + RELEASE_VERSION=$(xmlstarlet sel -t -v "/_:project/_:version" pom.xml) |
| 62 | + echo $RELEASE_VERSION |
| 63 | + echo "##vso[task.setvariable variable=RELEASE_VERSION]$RELEASE_VERSION" |
| 64 | + - task: CmdLine@2 |
| 65 | + displayName: Build core.jar |
| 66 | + inputs: |
| 67 | + script: | |
| 68 | + ./mvnw -N clean install -Dmaven.repo.local=./.repository |
| 69 | +
|
| 70 | + ./mvnw clean install -f com.microsoft.java.debug.core/pom.xml -Dmaven.repo.local=./.repository |
| 71 | +
|
| 72 | + mkdir -p jars |
| 73 | + mv .repository/com/microsoft/java/com.microsoft.java.debug.core/$RELEASE_VERSION/com.microsoft.java.debug.core*.jar jars/ |
| 74 | + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2 |
| 75 | + displayName: Sign core.jar |
| 76 | + inputs: |
| 77 | + ConnectedServiceName: vscjavaci_codesign |
| 78 | + FolderPath: jars |
| 79 | + Pattern: com.microsoft.java.debug.core*.jar |
| 80 | + signConfigType: inlineSignParams |
| 81 | + inlineOperation: |- |
| 82 | + [ |
| 83 | + { |
| 84 | + "KeyCode" : "CP-447347-Java", |
| 85 | + "OperationCode" : "JavaSign", |
| 86 | + "Parameters" : { |
| 87 | + "SigAlg" : "SHA256withRSA", |
| 88 | + "Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp" |
| 89 | + }, |
| 90 | + "ToolName" : "sign", |
| 91 | + "ToolVersion" : "1.0" |
| 92 | + }, |
| 93 | + { |
| 94 | + "KeyCode" : "CP-447347-Java", |
| 95 | + "OperationCode" : "JavaVerify", |
| 96 | + "Parameters" : {}, |
| 97 | + "ToolName" : "sign", |
| 98 | + "ToolVersion" : "1.0" |
| 99 | + } |
| 100 | + ] |
| 101 | + - task: CmdLine@2 |
| 102 | + displayName: install signed core.jar |
| 103 | + inputs: |
| 104 | + script: cp jars/com.microsoft.java.debug.core*.jar .repository/com/microsoft/java/com.microsoft.java.debug.core/$RELEASE_VERSION/ |
| 105 | + - task: CmdLine@2 |
| 106 | + displayName: Build plugin.jar |
| 107 | + inputs: |
| 108 | + script: |- |
| 109 | + ./mvnw clean install -f com.microsoft.java.debug.target/pom.xml -Dmaven.repo.local=./.repository |
| 110 | + ./mvnw clean install -f com.microsoft.java.debug.plugin/pom.xml -Dmaven.repo.local=./.repository |
| 111 | +
|
| 112 | + mkdir -p jars |
| 113 | + mv .repository/com/microsoft/java/com.microsoft.java.debug.plugin/$RELEASE_VERSION/com.microsoft.java.debug.plugin*.jar jars/ |
| 114 | + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2 |
| 115 | + displayName: Sign plugin.jar |
| 116 | + inputs: |
| 117 | + ConnectedServiceName: vscjavaci_codesign |
| 118 | + FolderPath: jars |
| 119 | + Pattern: com.microsoft.java.debug.plugin*.jar |
| 120 | + signConfigType: inlineSignParams |
| 121 | + inlineOperation: |- |
| 122 | + [ |
| 123 | + { |
| 124 | + "KeyCode" : "CP-447347-Java", |
| 125 | + "OperationCode" : "JavaSign", |
| 126 | + "Parameters" : { |
| 127 | + "SigAlg" : "SHA256withRSA", |
| 128 | + "Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp" |
| 129 | + }, |
| 130 | + "ToolName" : "sign", |
| 131 | + "ToolVersion" : "1.0" |
| 132 | + }, |
| 133 | + { |
| 134 | + "KeyCode" : "CP-447347-Java", |
| 135 | + "OperationCode" : "JavaVerify", |
| 136 | + "Parameters" : {}, |
| 137 | + "ToolName" : "sign", |
| 138 | + "ToolVersion" : "1.0" |
| 139 | + } |
| 140 | + ] |
| 141 | + - task: CmdLine@2 |
| 142 | + displayName: install signed plugin.jar |
| 143 | + inputs: |
| 144 | + script: cp jars/com.microsoft.java.debug.plugin*.jar .repository/com/microsoft/java/com.microsoft.java.debug.plugin/$RELEASE_VERSION/ |
| 145 | + - task: CmdLine@2 |
| 146 | + displayName: Build p2 artifacts |
| 147 | + inputs: |
| 148 | + script: |- |
| 149 | + # 3. Build the p2 artifacts. |
| 150 | + ./mvnw clean package -f com.microsoft.java.debug.repository/pom.xml -Dmaven.repo.local=./.repository |
| 151 | +
|
| 152 | + mkdir -p p2/target |
| 153 | + cp -r com.microsoft.java.debug.repository/target/repository p2/target/ |
| 154 | + cp com.microsoft.java.debug.repository/pushToBintray.sh p2/ |
| 155 | + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2 |
| 156 | + displayName: Sign p2 |
| 157 | + inputs: |
| 158 | + ConnectedServiceName: vscjavaci_codesign |
| 159 | + FolderPath: p2 |
| 160 | + Pattern: "*.jar" |
| 161 | + signConfigType: inlineSignParams |
| 162 | + inlineOperation: |- |
| 163 | + [ |
| 164 | + { |
| 165 | + "KeyCode" : "CP-447347-Java", |
| 166 | + "OperationCode" : "JavaSign", |
| 167 | + "Parameters" : { |
| 168 | + "SigAlg" : "SHA256withRSA", |
| 169 | + "Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp" |
| 170 | + }, |
| 171 | + "ToolName" : "sign", |
| 172 | + "ToolVersion" : "1.0" |
| 173 | + }, |
| 174 | + { |
| 175 | + "KeyCode" : "CP-447347-Java", |
| 176 | + "OperationCode" : "JavaVerify", |
| 177 | + "Parameters" : {}, |
| 178 | + "ToolName" : "sign", |
| 179 | + "ToolVersion" : "1.0" |
| 180 | + } |
| 181 | + ] |
| 182 | + - task: CmdLine@2 |
| 183 | + displayName: build m2 artifacts |
| 184 | + inputs: |
| 185 | + script: | |
| 186 | + ./mvnw source:jar -f com.microsoft.java.debug.core/pom.xml -Dmaven.repo.local=./.repository |
| 187 | + ./mvnw javadoc:jar -f com.microsoft.java.debug.core/pom.xml -Ddoclint=none -Dmaven.repo.local=./.repository |
| 188 | +
|
| 189 | + ./mvnw source:jar -f com.microsoft.java.debug.plugin/pom.xml -Dmaven.repo.local=./.repository |
| 190 | + ./mvnw javadoc:jar -f com.microsoft.java.debug.plugin/pom.xml -Ddoclint=none -Dmaven.repo.local=./.repository |
| 191 | +
|
| 192 | + mkdir -p m2/java-debug-parent |
| 193 | + cp pom.xml m2/java-debug-parent/java-debug-parent-$RELEASE_VERSION.pom |
| 194 | +
|
| 195 | + mkdir -p m2/com.microsoft.java.debug.core |
| 196 | + cp com.microsoft.java.debug.core/target/com.microsoft.java.debug.core*.jar m2/com.microsoft.java.debug.core |
| 197 | + cp com.microsoft.java.debug.core/pom.xml m2/com.microsoft.java.debug.core/com.microsoft.java.debug.core-$RELEASE_VERSION.pom |
| 198 | +
|
| 199 | + mkdir -p m2/com.microsoft.java.debug.plugin |
| 200 | + cp com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin*.jar m2/com.microsoft.java.debug.plugin |
| 201 | + cp com.microsoft.java.debug.plugin/pom.xml m2/com.microsoft.java.debug.plugin/com.microsoft.java.debug.plugin-$RELEASE_VERSION.pom |
| 202 | + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2 |
| 203 | + displayName: Sign m2 |
| 204 | + inputs: |
| 205 | + ConnectedServiceName: vscjavaci_codesign |
| 206 | + FolderPath: m2 |
| 207 | + Pattern: "*.jar" |
| 208 | + signConfigType: inlineSignParams |
| 209 | + inlineOperation: |- |
| 210 | + [ |
| 211 | + { |
| 212 | + "KeyCode" : "CP-447347-Java", |
| 213 | + "OperationCode" : "JavaSign", |
| 214 | + "Parameters" : { |
| 215 | + "SigAlg" : "SHA256withRSA", |
| 216 | + "Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp" |
| 217 | + }, |
| 218 | + "ToolName" : "sign", |
| 219 | + "ToolVersion" : "1.0" |
| 220 | + }, |
| 221 | + { |
| 222 | + "KeyCode" : "CP-447347-Java", |
| 223 | + "OperationCode" : "JavaVerify", |
| 224 | + "Parameters" : {}, |
| 225 | + "ToolName" : "sign", |
| 226 | + "ToolVersion" : "1.0" |
| 227 | + } |
| 228 | + ] |
| 229 | + - task: CopyFiles@2 |
| 230 | + displayName: "Copy p2/m2 to: $(Build.ArtifactStagingDirectory)" |
| 231 | + inputs: |
| 232 | + Contents: |+ |
| 233 | + p2/** |
| 234 | + m2/** |
| 235 | +
|
| 236 | + TargetFolder: $(Build.ArtifactStagingDirectory) |
0 commit comments