@@ -12,31 +12,27 @@ resources:
12
12
- repository : self
13
13
type : git
14
14
ref : refs/heads/main
15
- - repository : 1esPipelines
15
+ - repository : MicroBuildTemplate
16
16
type : git
17
- name : 1ESPipelineTemplates/1ESPipelineTemplates
18
- ref : refs/tags/release
17
+ name : 1ESPipelineTemplates/MicroBuildTemplate
19
18
trigger : none
20
19
extends :
21
- template : v1/ 1ES.Official.PipelineTemplate. yml@1esPipelines
20
+ template : azure-pipelines/MicroBuild. 1ES.Official.yml@MicroBuildTemplate
22
21
parameters :
23
22
pool :
24
- name : 1ES_JavaTooling_Pool
25
- image : 1ES_JavaTooling_Windows_2022
26
- os : windows
27
- sdl :
28
- sourceAnalysisPool :
29
- name : 1ES_JavaTooling_Pool
30
- image : 1ES_JavaTooling_Windows_2022
31
- os : windows
32
- customBuildTags :
33
- - MigrationTooling-mseng-VSJava-13463-Tool
23
+ name : MSEngSS-MicroBuild2022-1ES
34
24
stages :
35
25
- stage : Build
36
26
jobs :
37
27
- job : Job_1
38
28
displayName : Agent job 1
39
29
templateContext :
30
+ mb :
31
+ signing :
32
+ enabled : true
33
+ signType : real
34
+ zipSources : false
35
+ feedSource : ' https://mseng.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
40
36
outputs :
41
37
- output : pipelineArtifact
42
38
artifactName : extension
@@ -50,66 +46,57 @@ extends:
50
46
displayName : Use Node 20.x
51
47
inputs :
52
48
versionSpec : 20.x
49
+ # The image does not have jdk preinstalled, we need to download it first.
50
+ - task : PowerShell@2
51
+ displayName : Download JDK 17
52
+ inputs :
53
+ targetType : ' inline'
54
+ script : |-
55
+ New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk"
56
+ Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-17-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-17-windows-x64.zip"
53
57
- task : JavaToolInstaller@0
54
58
displayName : Use Java 17
55
59
inputs :
56
60
versionSpec : " 17"
57
61
jdkArchitectureOption : x64
58
- jdkSourceOption : PreInstalled
62
+ jdkSourceOption : LocalDirectory
63
+ jdkFile : $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-17-windows-x64.zip
64
+ jdkDestinationDirectory : $(Agent.ToolsDirectory)/ms-jdk17
65
+ - script : java --version
66
+ displayName : ' Check Java installation'
59
67
- task : Npm@1
60
68
displayName : npm install
61
69
inputs :
62
70
verbose : false
63
- - task : Bash@3
71
+ - task : CmdLine@2
64
72
displayName : npx gulp build_server
65
73
inputs :
66
74
targetType : inline
67
75
script : |-
68
76
# Build the jars to the server folder.
69
77
npm run build-server
70
- - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
71
- displayName : ESRP CodeSigning
78
+ - task : PowerShell@2
79
+ displayName : Sign Jars
72
80
inputs :
73
- ConnectedServiceName : ' ESRP-Release-Test'
74
- AppRegistrationClientId : ' 1992ee18-e9d2-42d6-ab20-94dd947a44b6'
75
- AppRegistrationTenantId : ' 72f988bf-86f1-41af-91ab-2d7cd011db47'
76
- AuthAKVName : ' vscjavaci'
77
- AuthCertName : ' vscjava-esrprelease-auth'
78
- AuthSignCertName : ' VSCJava-CodeSign'
79
- FolderPath : server
80
- Pattern : com.microsoft.jdtls.ext.*.jar
81
- signConfigType : inlineSignParams
82
- inlineOperation : |-
83
- [
84
- {
85
- "KeyCode" : "CP-447347-Java",
86
- "OperationCode" : "JavaSign",
87
- "Parameters" : {
88
- "SigAlg" : "SHA256withRSA",
89
- "Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
90
- },
91
- "ToolName" : "sign",
92
- "ToolVersion" : "1.0"
93
- },
94
- {
95
- "KeyCode" : "CP-447347-Java",
96
- "OperationCode" : "JavaVerify",
97
- "Parameters" : {},
98
- "ToolName" : "sign",
99
- "ToolVersion" : "1.0"
100
- }
101
- ]
81
+ targetType : ' inline'
82
+ script : |-
83
+ $files = Get-ChildItem -Path . -Recurse -Filter "com.microsoft.jdtls.ext.*.jar"
84
+ foreach ($file in $files) {
85
+ $fileName = $file.Name
86
+ & dotnet "$env:MBSIGN_APPFOLDER\DDSignFiles.dll" /file:"$fileName" /certs:100010171
87
+ }
88
+ workingDirectory : ' server'
102
89
- task : CmdLine@2
103
90
displayName : Replace AI Key
104
91
inputs :
105
92
script :
npx [email protected] -I -f package.json -e "this.aiKey=\"%AI_KEY%\""
106
- - task : Bash@3
107
- displayName : Bash Script
93
+ - task : PowerShell@2
94
+ displayName : Update package.json
108
95
inputs :
109
96
targetType : inline
110
97
script : |-
111
98
node ./scripts/prepare-nightly-build.js
112
- mv ./package.insiders.json ./package.json
99
+ Move-Item -Path " ./package.insiders.json" -Destination " ./package.json" -Force
113
100
- script : npx @vscode/vsce@latest package --pre-release -o extension.vsix
114
101
displayName : ' vsce package --pre-release'
115
102
# ## Copy files for APIScan
@@ -133,34 +120,12 @@ extends:
133
120
AzureServicesAuthConnectionString : runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
134
121
- script : npx @vscode/vsce@latest generate-manifest -i extension.vsix -o extension.manifest
135
122
displayName : ' Generate extension manifest'
136
- - script : cp extension.manifest extension.signature.p7s
123
+ - script : copy extension.manifest extension.signature.p7s
137
124
displayName : ' Prepare manifest for signing'
138
- - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
125
+ - task : CmdLine@2
126
+ displayName : Sign extension
139
127
inputs :
140
- ConnectedServiceName : ' ESRP-Release-Test'
141
- AppRegistrationClientId : ' 1992ee18-e9d2-42d6-ab20-94dd947a44b6'
142
- AppRegistrationTenantId : ' 72f988bf-86f1-41af-91ab-2d7cd011db47'
143
- AuthAKVName : ' vscjavaci'
144
- AuthCertName : ' vscjava-esrprelease-auth'
145
- AuthSignCertName : ' VSCJava-CodeSign'
146
- FolderPath : ' .'
147
- Pattern : ' extension.signature.p7s'
148
- signConfigType : inlineSignParams
149
- inlineOperation : |
150
- [
151
- {
152
- "keyCode": "CP-401405",
153
- "operationSetCode": "VSCodePublisherSign",
154
- "parameters" : [],
155
- "toolName": "sign",
156
- "toolVersion": "1.0"
157
- }
158
- ]
159
- SessionTimeout : 90
160
- MaxConcurrency : 25
161
- MaxRetryAttempts : 5
162
- PendingAnalysisWaitTimeoutMinutes : 5
163
- displayName : ' Sign extension'
128
+ script : dotnet %MBSIGN_APPFOLDER%/ddsignfiles.dll /file:extension.signature.p7s /certs:4014052
164
129
- task : CopyFiles@2
165
130
displayName : " Copy Files to: $(Build.ArtifactStagingDirectory)"
166
131
inputs :
0 commit comments