Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gradle build server support. #1391

Merged
merged 38 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a12625f
Initialize the jdtls plugin (#1353)
jdneo Jul 25, 2023
e3c5acb
Launch build server from importer (#1354)
jdneo Jul 26, 2023
e530070
Handle the project description file for build targets (#1355)
jdneo Jul 27, 2023
50e9b33
Resolve source classpath entries (#1356)
jdneo Jul 28, 2023
456328a
Set resources to classpath (#1357)
jdneo Jul 28, 2023
9a7d4c4
Set JDK to the classpath (#1358)
jdneo Jul 30, 2023
f4a2231
Pass preference to build server (#1359)
jdneo Jul 30, 2023
28eb827
Add jar dependencies (#1361)
jdneo Jul 31, 2023
97d6303
Add project dependencies (#1362)
jdneo Jul 31, 2023
62be78f
Support 'Reload Projects' (#1363)
jdneo Jul 31, 2023
9df2262
Configure build server builder for projects (#1364)
jdneo Jul 31, 2023
a7d503b
Add missing builders during import (#1365)
jdneo Aug 1, 2023
784da9c
Introduce 'auto' for build server setting (#1367)
jdneo Aug 1, 2023
6861ef9
Fix the status code assignment (#1368)
jdneo Aug 1, 2023
b98f7f6
Support logging build output (#1366)
jdneo Aug 2, 2023
d3a4d1d
Fix the setting parsing error (#1370)
jdneo Aug 2, 2023
1232d93
Report import progress (#1371)
jdneo Aug 2, 2023
53ada41
Add log handlers (#1372)
jdneo Aug 4, 2023
5267410
fix: Turn on 'callOnEmptyDelta' for builder (#1373)
jdneo Aug 7, 2023
b37d24d
fix: Refresh the output folders directly (#1374)
jdneo Aug 7, 2023
3f52589
Improve the project JDK detection. (#1375)
jdneo Aug 9, 2023
25f221c
Dedup entries with the same path in classpath entries (#1377)
jdneo Aug 14, 2023
a90a3d7
Allow the linked target folder does not exist when creating (#1378)
jdneo Aug 15, 2023
60de004
Migrate to new progress report api (#1379)
jdneo Aug 15, 2023
8de57eb
Set source/target level to Java projects (#1380)
jdneo Aug 15, 2023
73e1baa
Set module attribute if the project is modular (#1381)
jdneo Aug 16, 2023
fe9b1cd
Remove tasks to build build-server jars
jdneo Aug 16, 2023
0cbf8a0
Add permission to mvnw
jdneo Aug 16, 2023
90b535e
Add exclusion pattern to the source entries (#1382)
jdneo Aug 17, 2023
8eb5596
Only add module attribute for non-test entries (#1383)
jdneo Aug 18, 2023
cc62d67
Set compiler compliance level to Java projects (#1384)
jdneo Aug 18, 2023
55f61dd
Use the compliance version as the expected jdk version (#1385)
jdneo Aug 18, 2023
52ecc0e
Automatically check for compilation errors when source files are chan…
testforstephen Aug 21, 2023
0d4d119
Pass available JDKs to build server (#1387)
jdneo Aug 23, 2023
14a56a8
Remove server storage property (#1389)
jdneo Aug 24, 2023
e33aeb3
Pick highest source/target level (#1388)
jdneo Aug 24, 2023
85a6bf8
Setup ci build and & nightly build (#1390)
jdneo Aug 28, 2023
cf73a46
Fix lint errors
jdneo Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .azure-pipelines/vscode-gradle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,35 @@ jobs:
inputs:
artifact: 'NOTICE.txt'
path: $(Build.SourcesDirectory)/extension
- task: DownloadBuildArtifacts@1
displayName: 'Download Build Server Artifacts'
inputs:
buildType: specific
project: 'a4d27ce2-a42d-4b71-8eef-78cee9a9728e'
pipeline: 15023
downloadType: specific
extractTars: false
- task: CopyFiles@2
displayName: 'Copy Build Server Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/extension/server
- task: JavaToolInstaller@0
displayName: Install Java 17
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: Gradle@2
displayName: Build
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: ':extension:copyJdtlsPluginJar'
- bash: |
cd $(Build.SourcesDirectory)/extension
npx vsce@latest package
npx @vscode/vsce@latest package
displayName: Package VSIX
- task: CopyFiles@2
displayName: Copy VSIX
Expand Down
55 changes: 54 additions & 1 deletion .azure-pipelines/vscode-gradle-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,62 @@ steps:
inputs:
artifact: 'NOTICE.txt'
path: $(Build.SourcesDirectory)/extension
- task: DownloadBuildArtifacts@1
displayName: 'Download Build Server Artifacts'
inputs:
buildType: specific
project: 'a4d27ce2-a42d-4b71-8eef-78cee9a9728e'
pipeline: 15024
downloadType: specific
extractTars: false
- task: CopyFiles@2
displayName: 'Copy Build Server Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/extension/server
- task: JavaToolInstaller@0
displayName: Install Java 17
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: Gradle@2
displayName: Build
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: ':extension:copyJdtlsPluginJar'
- task: EsrpCodeSigning@2
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'vscjavaci_codesign'
FolderPath: 'extension/server'
Pattern: 'com.microsoft.gradle.bs.importer-*.jar'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"KeyCode" : "CP-447347-Java",
"OperationCode" : "JavaSign",
"Parameters" : {
"SigAlg" : "SHA256withRSA",
"Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-447347-Java",
"OperationCode" : "JavaVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
- bash: |
cd $(Build.SourcesDirectory)/extension
npx vsce@latest package --pre-release
npx @vscode/vsce@latest package --pre-release
displayName: Package VSIX
- task: CopyFiles@2
displayName: Copy VSIX
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/vscode-gradle-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ steps:
path: $(Build.SourcesDirectory)/extension
- bash: |
cd $(Build.SourcesDirectory)/extension
npx vsce@latest package
npx @vscode/vsce@latest package
displayName: Package VSIX
- task: CopyFiles@2
displayName: Copy VSIX
Expand Down
13 changes: 12 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@
"presentation": {
"group": "debug",
"order": 1
}
},
"env": {
"DEBUG_VSCODE_JAVA":"true"
},
},
{
"type": "java",
"name": "Attach to JDT.LS Plugin",
"request": "attach",
"hostName": "localhost",
"port": "1044",
"projectName": "com.microsoft.gradle.bs.importer"
},
{
"type": "java",
Expand Down
5 changes: 4 additions & 1 deletion extension/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ node_modules
*.vsix
.vscode-test
/lib
.classpath
!jdtls.ext/**/.project
!jdtls.ext/**/.classpath
.settings
/src/proto/
/*.md
/images
server
jdtls.ext/com.microsoft.gradle.bs.importer/lib/*.jar
4 changes: 4 additions & 0 deletions extension/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ lib/*.md
scripts
# for nightly build
package.insiders.json
jdtls.ext
build-server-for-gradle
#codesign
**/CodeSignSummary-*.md
41 changes: 41 additions & 0 deletions extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,45 @@ task prepareForBetaRelease() {
dependsOn bundle, copyDocs, prepareBeta
}

task buildJdtlsPlugin(type: CrossPlatformExec) {
workingDir file('./jdtls.ext')
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'mvnw', 'clean', 'package'
} else {
commandLine './mvnw', 'clean', 'package'
}
}

task copyJdtlsPluginJar(type: Copy) {
dependsOn ':extension:buildJdtlsPlugin'
from('./jdtls.ext/com.microsoft.gradle.bs.importer/target/') {
include 'com.microsoft.gradle.bs.importer-*.jar'
}
into 'server'
mustRunAfter copyDocs
}

task buildBuildServer(type: CrossPlatformExec) {
workingDir file('./build-server-for-gradle')
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'gradlew', 'build', '-x', 'test'
} else {
commandLine './gradlew', 'build', '-x', 'test'
}
}

task copyBuildServerJars(type: Copy) {
dependsOn ':extension:buildBuildServer'
from('./build-server-for-gradle/server/build/libs/') {
include '**/*.jar'
include '**/init.gradle'
}
into 'server'
mustRunAfter copyDocs
}

task buildJars() {
dependsOn copyJdtlsPluginJar, copyBuildServerJars
}

build.finalizedBy buildProd, buildTest
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
17 changes: 17 additions & 0 deletions extension/jdtls.ext/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gradle-jdtls-ext-parent</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.microsoft.gradle.bs.importer.target</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="JDTLS.EXT" sequenceNumber="39">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.apache.commons.lang3" version="3.1.0.v201403281430"/>
<repository location="https://download.eclipse.org/tools/orbit/R-builds/R20200529191137/repository"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.core.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.p2.core.feature.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.jdt.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2023-06/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.xtext.xbase.lib" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2023-06/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jdt.ls.core" version="0.0.0"/>
<repository location="https://download.eclipse.org/jdtls/snapshots/repository/latest/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4j/updates/releases/0.21.0/"/>
<unit id="org.eclipse.lsp4j" version="0.0.0"/>
</location>
</locations>
</target>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.gradle.jdtls.ext</groupId>
<artifactId>gradle-jdtls-ext-parent</artifactId>
<version>0.1.0</version>
</parent>
<artifactId>com.microsoft.gradle.bs.importer.tp</artifactId>
<name>${base.name} :: Target Platform</name>
<packaging>eclipse-target-definition</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="lib" path="lib/bsp4j-2.1.0-M4.jar"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
45 changes: 45 additions & 0 deletions extension/jdtls.ext/com.microsoft.gradle.bs.importer/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.microsoft.gradle.bs.importer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1690177359886</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Gradle Build Server Importer
Bundle-SymbolicName: com.microsoft.gradle.bs.importer;singleton:=true
Bundle-Version: 0.1.0
Bundle-Activator: com.microsoft.gradle.bs.importer.ImporterPlugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.jdt.core,
org.eclipse.jdt.launching,
org.osgi.framework;version="1.3.0"
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jdt.ls.core,
org.eclipse.jdt.core,
org.eclipse.lsp4j,
org.eclipse.lsp4j.jsonrpc,
org.eclipse.core.resources,
org.eclipse.jdt.launching,
org.apache.commons.lang3
Bundle-ClassPath: lib/bsp4j-2.1.0-M4.jar,
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
lib/bsp4j-2.1.0-M4.jar
Loading