Skip to content

Commit 70630ef

Browse files
authored
Merge pull request OpenLiberty#575 from mattbsox/lcls-2.4.1
Update LCLS to 2.4.1
2 parents e1fdb3e + 2f80f2d commit 70630ef

3 files changed

Lines changed: 39 additions & 26 deletions

File tree

gulpfile.js

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ const finishedAsync = promisify(finished);
1313

1414
const MC_BASE_URL = "https://repo1.maven.org/maven2";
1515
const MC_SNAPSHOT_BASE_URL = "https://central.sonatype.com/repository/maven-snapshots";
16+
const ECLIPSE_BASE_URL = "https://repo.eclipse.org/content/repositories";
17+
const ECLIPSE_SNAPSHOT_BASE_URL = "https://repo.eclipse.org/content/repositories";
1618

1719
const libertyGroupId = "io.openliberty.tools";
1820
const libertyLemminxArtifactId = "liberty-langserver-lemminx";
1921
const libertyLSArtifactId = "liberty-langserver";
20-
const libertyVersion = "2.4";
22+
const libertyVersion = "2.4.1";
2123
const jakartaGroupId = "org.eclipse.lsp4jakarta";
24+
const jakartaJdtArtifactId = "org.eclipse.lsp4jakarta.jdt.core";
25+
const jakartaLSArtifactId = "org.eclipse.lsp4jakarta.ls";
2226
const jakartaVersion = "0.2.5";
2327
var lclsReleaseLevel = "releases"; //snapshots or releases
2428
var jakartaReleaseLevel = "releases";
@@ -86,29 +90,22 @@ gulp.task("downloadLibertyLSJars", async function() {
8690
]);
8791
});
8892

89-
//https://repo.eclipse.org/service/local/artifact/maven/content?r=snapshots&g=org.eclipse.lsp4jakarta&a=org.eclipse.lsp4jakarta.jdt.core&v=0.0.1-SNAPSHOT
90-
//https://repo.eclipse.org/service/local/artifact/maven/content?r=snapshots&g=org.eclipse.lsp4jakarta&a=org.eclipse.lsp4jakarta.ls&c=jar-with-dependencies&v=0.0.1-SNAPSHOT
91-
const eclipseRepoURL = "https://repo.eclipse.org/service/local/artifact/maven/content";
92-
const jakartaReleaseLevelString = "?r=" + jakartaReleaseLevel;
93-
const jakartaGroupIdString = "&g=" + jakartaGroupId;
94-
const jakartaVersionString = "&v=" + jakartaVersion;
95-
const jakartaClassifierString = "&c=jar-with-dependencies";
96-
97-
const jakartaJDTURL = eclipseRepoURL + jakartaReleaseLevelString + jakartaGroupIdString + "&a=org.eclipse.lsp4jakarta.jdt.core" + jakartaVersionString;
98-
const jakartaLSURL = eclipseRepoURL + jakartaReleaseLevelString + jakartaGroupIdString + "&a=org.eclipse.lsp4jakarta.ls" + jakartaClassifierString + jakartaVersionString;
99-
100-
gulp.task("downloadLSP4JakartaJars", (done) => {
101-
download({
102-
url: jakartaJDTURL,
103-
file: jakartaJdtName,
104-
})
105-
.pipe(gulp.dest("./jars", { encoding: false}));
106-
download({
107-
url: jakartaLSURL,
108-
file: jakartaLSName,
109-
})
110-
.pipe(gulp.dest("./jars", { encoding: false}));
111-
done();
93+
gulp.task("downloadLSP4JakartaJars", async function() {
94+
var jakartaJDTURL;
95+
var jakartaLSURL;
96+
97+
if (jakartaReleaseLevel === "snapshots") {
98+
jakartaJDTURL = getEclipseJarURL(jakartaGroupId, jakartaJdtArtifactId, jakartaVersion, null, true);
99+
jakartaLSURL = getEclipseJarURL(jakartaGroupId, jakartaLSArtifactId, jakartaVersion, "jar-with-dependencies", true);
100+
} else {
101+
jakartaJDTURL = getEclipseJarURL(jakartaGroupId, jakartaJdtArtifactId, jakartaVersion, null, false);
102+
jakartaLSURL = getEclipseJarURL(jakartaGroupId, jakartaLSArtifactId, jakartaVersion, "jar-with-dependencies", false);
103+
}
104+
105+
await Promise.all([
106+
downloadJar(jakartaJDTURL, jakartaJdtName, "./jars"),
107+
downloadJar(jakartaLSURL, jakartaLSName, "./jars")
108+
]);
112109
});
113110

114111
function mvnw() {
@@ -130,6 +127,12 @@ async function downloadJar(url, fileName, destDir) {
130127
});
131128

132129
console.log(`Downloading ${url}`);
130+
131+
// Ensure destination directory exists
132+
if (!fs.existsSync(destDir)) {
133+
fs.mkdirSync(destDir, { recursive: true });
134+
}
135+
133136
const fullPath = path.join(destDir, fileName);
134137
const writer = fs.createWriteStream(fullPath);
135138
response.data.pipe(writer);
@@ -145,6 +148,16 @@ function getMavenCentralJarURL (groupId, artifactId, version, classifier) {
145148
return mavenCentralJarURL;
146149
}
147150

151+
// Generate Eclipse repository artifact URL for specified GAV coordinates
152+
// Example: https://repo.eclipse.org/content/repositories/lsp4jakarta-maven2-releases/org/eclipse/lsp4jakarta/org.eclipse.lsp4jakarta.jdt.core/0.2.5/org.eclipse.lsp4jakarta.jdt.core-0.2.5.jar
153+
function getEclipseJarURL (groupId, artifactId, version, classifier, isSnapshot) {
154+
const repoName = isSnapshot ? "lsp4jakarta-maven2-snapshots" : "lsp4jakarta-maven2-releases";
155+
const baseURL = isSnapshot ? ECLIPSE_SNAPSHOT_BASE_URL : ECLIPSE_BASE_URL;
156+
const classifierString = classifier ? `-${classifier}` : '';
157+
const eclipseJarURL = `${baseURL}/${repoName}/${groupId.replace(/\./g, '/')}/${artifactId}/${version}/${artifactId}-${version}${classifierString}.jar`;
158+
return eclipseJarURL;
159+
}
160+
148161
// No API provided to retrieve snapshot artifacts hosted on https://central.sonatype.com/repository/maven-snapshots
149162
// Can access maven-metadata.xml using GAV coordinates for artifacts
150163
// Will parse retrieved maven-metadata.xml for full artifact version, including timestamp

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"./jars/org.eclipse.lsp4jakarta.jdt.core-0.2.5.jar"
5454
],
5555
"xml.javaExtensions": [
56-
"./jars/liberty-langserver-lemminx-2.4-jar-with-dependencies.jar"
56+
"./jars/liberty-langserver-lemminx-2.4.1-jar-with-dependencies.jar"
5757
],
5858
"views": {
5959
"explorer": [

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const JAVA_EXTENSION_ID = "redhat.java";
2121

2222
const LIBERTY_CLIENT_ID = "LANGUAGE_ID_LIBERTY";
2323
const JAKARTA_CLIENT_ID = "LANGUAGE_ID_JAKARTA";
24-
export const LIBERTY_LS_JAR = "liberty-langserver-2.4-jar-with-dependencies.jar";
24+
export const LIBERTY_LS_JAR = "liberty-langserver-2.4.1-jar-with-dependencies.jar";
2525
export const JAKARTA_LS_JAR = "org.eclipse.lsp4jakarta.ls-0.2.5-jar-with-dependencies.jar";
2626

2727
let libertyClient: LanguageClient;

0 commit comments

Comments
 (0)