Skip to content

Commit 7079c43

Browse files
EskibearCsCherrYYjdneo
authored
v0.18.7 RC bits (#827)
* update third party notices (#784) Signed-off-by: Yan Zhang <[email protected]> * Exp: rollout getting started walkthrough (#796) Signed-off-by: Yan Zhang <[email protected]> * Add configure formatter settings entry in help center (#802) * support to detect arm-macOS (#808) Signed-off-by: Yan Zhang <[email protected]> * fix: Get correct project type (#804) Signed-off-by: Sheng Chen <[email protected]> * upversion to 0.18.7 Signed-off-by: Yan Zhang <[email protected]> Co-authored-by: Shi Chen <[email protected]> Co-authored-by: Sheng Chen <[email protected]>
1 parent 4f5ed7b commit 7079c43

File tree

15 files changed

+1381
-9412
lines changed

15 files changed

+1381
-9412
lines changed

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ webpack.config.js
1414
out/**/*.map
1515
out/assets/**/*.js
1616
*.vsix
17+
scripts

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 0.18.6
4+
### Fixed
5+
- Support to detect macOS with ARM chips.
6+
- Get correct project type.
7+
38
## 0.18.6
49
### Changed
510
- Adopt Adoptium API v3 to download JDK 17. [#765](https://github.com/microsoft/vscode-java-pack/pull/765)

ThirdPartyNotices.txt

Lines changed: 625 additions & 0 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 634 additions & 9308 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Extension Pack for Java",
44
"description": "Popular extensions for Java development that provides Java IntelliSense, debugging, testing, Maven/Gradle support, project management and more",
55
"license": "MIT",
6-
"version": "0.18.6",
6+
"version": "0.18.7",
77
"publisher": "vscjava",
88
"preview": true,
99
"engines": {
@@ -314,14 +314,13 @@
314314
"vscode:prepublish": "npm run build",
315315
"compile": "webpack --config webpack.config.js",
316316
"watch": "webpack --config webpack.config.js --watch --info-verbosity verbose",
317-
"build": "webpack --config webpack.config.js --mode=\"production\""
317+
"build": "webpack --config webpack.config.js --mode=\"production\"",
318+
"update-tpn": "node scripts/update-third-party-notice.js"
318319
},
319320
"devDependencies": {
320-
"@iconify-icons/codicon": "^1.1.8",
321-
"@iconify/react": "^1.1.3",
322-
"@reduxjs/toolkit": "^1.5.0",
323321
"@types/bytes": "^3.1.0",
324322
"@types/expand-tilde": "^2.0.0",
323+
"@types/fs-extra": "^9.0.1",
325324
"@types/lodash": "^4.14.161",
326325
"@types/minimatch": "^3.0.3",
327326
"@types/node": "^8.10.63",
@@ -335,41 +334,22 @@
335334
"@types/vscode": "1.52.0",
336335
"@types/winreg": "^1.2.30",
337336
"@types/xmldom": "^0.1.30",
338-
"axios": "^0.21.2",
339-
"arch": "^2.1.2",
340337
"autoprefixer": "^8.5.1",
341-
"bootstrap": "^4.5.2",
342338
"bytes": "^3.1.0",
343339
"css-loader": "^3.6.0",
344-
"expand-tilde": "^2.0.2",
345340
"file-loader": "^6.2.0",
346-
"find-java-home": "^1.1.0",
347-
"highlight.js": "10.5.0",
348341
"html-webpack-inline-source-plugin": "0.0.10",
349342
"html-webpack-plugin": "^3.2.0",
350-
"jquery": "^3.5.1",
351-
"lodash": "^4.17.21",
352-
"minimatch": "^3.0.4",
353343
"node-sass": "^4.14.1",
354-
"path-exists": "^3.0.0",
355-
"popper.js": "^1.16.1",
356344
"postcss-loader": "^2.1.5",
357-
"react": "^17.0.1",
358-
"react-bootstrap": "^1.4.3",
359-
"react-dom": "^17.0.1",
360-
"react-redux": "^7.2.2",
361-
"request": "^2.88.2",
362-
"request-promise-native": "^1.0.9",
363345
"sass-loader": "^7.3.1",
364346
"style-loader": "^0.21.0",
365347
"ts-loader": "^4.3.0",
366348
"tslint": "^5.20.1",
367349
"typescript": "^3.7.5",
368350
"url-loader": "^4.1.1",
369-
"vscode-tas-client": "^0.1.22",
370351
"webpack": "^4.44.1",
371-
"webpack-cli": "^3.3.12",
372-
"xmldom": "^0.6.0"
352+
"webpack-cli": "^3.3.12"
373353
},
374354
"extensionPack": [
375355
"redhat.java",
@@ -380,12 +360,31 @@
380360
"VisualStudioExptTeam.vscodeintellicode"
381361
],
382362
"dependencies": {
383-
"@types/fs-extra": "^9.0.1",
363+
"@iconify-icons/codicon": "^1.1.8",
364+
"@iconify/react": "^1.1.4",
365+
"@reduxjs/toolkit": "^1.5.0",
366+
"arch": "^2.1.2",
367+
"axios": "^0.21.2",
368+
"bootstrap": "^4.5.2",
384369
"compare-versions": "^3.6.0",
385370
"expand-home-dir": "0.0.3",
371+
"expand-tilde": "^2.0.2",
372+
"find-java-home": "^1.1.0",
386373
"fs-extra": "^9.0.1",
374+
"highlight.js": "10.5.0",
375+
"jquery": "^3.5.1",
376+
"lodash": "^4.17.21",
377+
"minimatch": "^3.0.4",
378+
"react": "^17.0.1",
379+
"react-bootstrap": "^1.4.3",
380+
"react-dom": "^17.0.1",
381+
"react-redux": "^7.2.2",
382+
"request": "^2.88.2",
383+
"request-promise-native": "^1.0.9",
387384
"semver": "^5.7.1",
388385
"vscode-extension-telemetry-wrapper": "^0.9.0",
389-
"winreg-utf8": "^0.1.1"
386+
"vscode-tas-client": "^0.1.22",
387+
"winreg-utf8": "^0.1.1",
388+
"xmldom": "^0.6.0"
390389
}
391390
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const formatRepositoryUrl = (url) => {
4+
if (!url) return url;
5+
url = url.replace(/\/$/, "");
6+
url = url.replace(/\.git$/, "");
7+
url = url.replace(/^git\+/, "");
8+
url = url.replace(/^git:github\.com:/, "https://github.com/");
9+
url = url.replace(/^git:\/\//, "https://");
10+
url = url.replace(/^ssh:\/\/git@/, "https://");
11+
return url;
12+
}
13+
14+
const packageJSON = require(path.join(__dirname, "..", "package.json"));
15+
16+
const header = `THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
17+
For ${packageJSON.name} package
18+
19+
This extension uses Open Source components. You can find the source code of their
20+
open source projects along with the license information below. We acknowledge and
21+
are grateful to these developers for their contribution to open source.
22+
23+
`;
24+
25+
const entries = Object.keys(packageJSON.dependencies).map((name, idx) => {
26+
console.log("===>>>");
27+
console.log(name);
28+
// url
29+
const manifestFile = require(path.join(__dirname, "..", "node_modules", name, "package.json"));
30+
let url = manifestFile.repository?.url ?? manifestFile.repository;
31+
console.log(url, "\t", formatRepositoryUrl(url));
32+
url = formatRepositoryUrl(url);
33+
34+
// license
35+
const packageRoot = path.join(__dirname, "..", "node_modules", name);
36+
const files = fs.readdirSync(packageRoot);
37+
const licenseFile = files.find(f => f.match(/^license/i));
38+
const license = licenseFile ? fs.readFileSync(path.join(packageRoot, licenseFile)) : undefined;
39+
console.log("<<<===");
40+
return {
41+
name,
42+
url,
43+
license
44+
}
45+
46+
});
47+
48+
const depsWithLicense = entries.filter(e => e.name !== undefined && e.license !== undefined);
49+
50+
const toc = depsWithLicense.map((dep, idx) => {
51+
return `${idx + 1}. ${dep.name} (${dep.url})`;
52+
}).join("\n") + "\n";
53+
54+
const licenses = depsWithLicense.map(dep => {
55+
return `${dep.name} NOTICES BEGIN HERE
56+
=============================
57+
${dep.license}
58+
=========================================
59+
END OF ${dep.name} NOTICES AND INFORMATION
60+
`;
61+
}).join("\n");
62+
63+
const content = [header, toc, licenses].join("\n");
64+
fs.writeFileSync(path.join(__dirname, "..", "ThirdPartyNotices.txt"), content);

src/extension.ts

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33

44
import * as vscode from "vscode";
55
import { dispose as disposeTelemetryWrapper, initialize, instrumentOperation } from "vscode-extension-telemetry-wrapper";
6-
import { initialize as initUtils } from "./utils";
6+
import { ClassPathConfigurationViewSerializer } from "./classpath/classpathConfigurationView";
77
import { initialize as initCommands } from "./commands";
8-
import { initialize as initRecommendations } from "./recommendation";
9-
import { showReleaseNotesOnStart, HelpViewType } from "./misc";
108
import { initialize as initExp } from "./exp";
11-
import { OverviewViewSerializer } from "./overview";
12-
import { JavaRuntimeViewSerializer, validateJavaRuntime } from "./java-runtime";
13-
import { scheduleAction } from "./utils/scheduler";
14-
import { showWelcomeWebview, WelcomeViewSerializer } from "./welcome";
15-
import { JavaGettingStartedViewSerializer } from "./getting-started";
169
import { JavaExtGuideViewSerializer } from "./ext-guide";
17-
import { ClassPathConfigurationViewSerializer } from "./classpath/classpathConfigurationView";
1810
import { initFormatterSettingsEditorProvider } from "./formatter-settings";
1911
import { initRemoteProfileProvider } from "./formatter-settings/RemoteProfileProvider";
12+
import { JavaGettingStartedViewSerializer } from "./getting-started";
13+
import { JavaRuntimeViewSerializer, validateJavaRuntime } from "./java-runtime";
14+
import { HelpViewType, showReleaseNotesOnStart } from "./misc";
15+
import { OverviewViewSerializer } from "./overview";
2016
import { CodeActionProvider } from "./providers/CodeActionProvider";
21-
import { KEY_IS_WELCOME_PAGE_VIEWED, KEY_SHOW_WHEN_USING_JAVA } from "./utils/globalState";
22-
import { isWalkthroughEnabled } from "./utils/walkthrough";
17+
import { initialize as initRecommendations } from "./recommendation";
18+
import { initialize as initUtils } from "./utils";
19+
import { KEY_SHOW_WHEN_USING_JAVA } from "./utils/globalState";
20+
import { scheduleAction } from "./utils/scheduler";
21+
import { showWelcomeWebview, WelcomeViewSerializer } from "./welcome";
2322

2423
export async function activate(context: vscode.ExtensionContext) {
2524
syncState(context);
@@ -48,15 +47,6 @@ async function initializeExtension(_operationId: string, context: vscode.Extensi
4847

4948
const config = vscode.workspace.getConfiguration("java.help");
5049

51-
// for control group where walkthrough is not enabled, present first view for once.
52-
const walkthroughEnabled = await isWalkthroughEnabled();
53-
if (walkthroughEnabled === false // control group
54-
&& !context.globalState.get(KEY_IS_WELCOME_PAGE_VIEWED) // first time
55-
&& vscode.env.uiKind === vscode.UIKind.Desktop // desktop only (no popups on Codespaces)
56-
) {
57-
presentFirstView(context);
58-
}
59-
6050
if (config.get("firstView") !== HelpViewType.None && context.globalState.get(KEY_SHOW_WHEN_USING_JAVA)) {
6151
scheduleAction("showFirstView", true).then(() => {
6252
presentFirstView(context);

src/java-runtime/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ export async function suggestOpenJdk(jdkVersion: string = "openjdk17", impl: str
309309
os = "linux";
310310
}
311311

312-
let arch = architecture();
313-
if (arch === "x86") {
314-
arch = "x32";
312+
let arch = process.arch;
313+
if (arch === "arm64") {
314+
arch = "aarch64";
315315
}
316316

317317
const majorVersion = jdkVersion.replace(/^openjdk/, "");

src/java-runtime/utils/adoptiumApi.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ export async function latestAssets(featureVersion: string, jvmImpl: string): Pro
9898
return response;
9999
}
100100

101-
102-
103101
interface AdoptiumReleaseInfo {
104102
available_lts_releases: number[];
105103
available_releases: number[];

src/utils/jdt.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ export async function getProjectType(fsPath: string): Promise<ProjectType> {
1010
if (isDefaultProject(fsPath)) {
1111
return ProjectType.Default;
1212
}
13-
const dotProjectFile = path.join(fsPath, ".project");
14-
if (!await fse.pathExists(dotProjectFile)) { // for invisible projects, .project file is located in workspace storage.
15-
return ProjectType.UnmanagedFolder;
16-
}
1713
const buildDotGradleFile = path.join(fsPath, "build.gradle");
1814
if (await fse.pathExists(buildDotGradleFile)) {
1915
return ProjectType.Gradle;
@@ -22,6 +18,10 @@ export async function getProjectType(fsPath: string): Promise<ProjectType> {
2218
if (await fse.pathExists(pomDotXmlFile)) {
2319
return ProjectType.Maven;
2420
}
21+
const dotProjectFile = path.join(fsPath, ".project");
22+
if (!await fse.pathExists(dotProjectFile)) { // for invisible projects, .project file is located in workspace storage.
23+
return ProjectType.UnmanagedFolder;
24+
}
2525
return ProjectType.Others;
2626
}
2727

0 commit comments

Comments
 (0)