Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions compiler-host.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"repository": "https://github.com/1lck/Lithe-IDEA",
"revision": "e9ce7781f1a9635ced8a090b45a159af4f5ce959",
"coreRevision": "5802c42b5766df7375bd427c54203db415ff72d7",
"revision": "0d4e28fe4d4ebb6741a4faa30a0c7ec8c3c8609d",
"coreRevision": "39aa5fb51fcbc9c986536d1c48ab9665e4a68a62",
"package": "io.github.lithe-idea.maven-build"
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ func TestPluginNativeSourceVisual(t *testing.T) {
fetch := func(context.Context) (marketplace.Snapshot, error) {
return marketplace.Snapshot{Index: core.MarketplaceIndex{Plugins: []core.MarketplacePlugin{{ID: metadata.ID, Name: metadata.DisplayName, LatestVersion: metadata.Version}}}}, nil
}
w := newWindow(NewController(Options{Text: func() *i18n.Messages { return i18n.For(language) }, Language: func() i18n.Language { return language }, SystemLanguage: language, SystemDark: func() bool { return theme == "dark" }, PluginSettings: source, SettingsNavigation: core.NewClient().SettingsNavigation, SettingsPages: func(ctx context.Context) ([]core.SettingsPage, error) {
return core.NewClient().SettingsPages(ctx, []core.SettingsContribution{{Manifest: manifest, Owner: core.PluginSettingsOwner{PluginID: metadata.ID, Version: metadata.Version}, Enabled: true}})
w := newWindow(NewController(Options{Text: func() *i18n.Messages { return i18n.For(language) }, Language: func() i18n.Language { return language }, SystemLanguage: language, SystemDark: func() bool { return theme == "dark" }, PluginSettings: source, SettingsNavigation: core.NewClient().SettingsNavigation, SettingsPages: func(ctx context.Context, language i18n.Language) ([]core.SettingsPage, error) {
return core.NewClient().SettingsPages(ctx, []core.SettingsContribution{{Manifest: manifest, Owner: core.PluginSettingsOwner{PluginID: metadata.ID, Version: metadata.Version}, Enabled: true}}, language.Code())
}, Marketplace: fetch, MarketplaceInstalled: fetch, PluginState: func(string) PluginState {
return PluginState{Installed: true, Enabled: true, Version: metadata.Version}
}}), Values{Theme: theme, Language: language.Code()})
Expand Down
6 changes: 3 additions & 3 deletions io.github.lithe-idea.maven-build/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Maven",
"version": "1.0.2",
"pluginAPIVersion": 0,
"requires": {"buildSystems": 0, "buildProviders": 1, "projectGenerators": 0, "runConfigurationTypes": 0, "beforeLaunchTasks": 0, "settings": 0, "backend": 0, "sourceSettings": 0},
"requires": {"buildSystems": 2, "buildProviders": 1, "projectGenerators": 0, "runConfigurationTypes": 0, "beforeLaunchTasks": 0, "settings": 0, "backend": 0, "sourceSettings": 0},
"vendor": {"id": "io.github.lithe-idea", "displayName": "Lithe Community", "signatureRequirement": "none"},
"permissions": ["process.build", "project.generate", "backend.launch", "languageServer.launch", "workspace.metadata"],
"activationEvents": ["onBuildSystem:maven"],
Expand Down Expand Up @@ -404,8 +404,8 @@
],
"run": [
{"id": "spring-boot", "source": "provider", "fromTargets": {"tags": ["spring-boot"]}, "execution": "service", "debug": {"configurationType": "java"}},
{"id": "application", "source": "provider", "fromTargets": {"tags": ["java-application"]}, "execution": "application"},
{"id": "main", "source": "provider", "entrypoints": true}
{"id": "application", "source": "provider", "fromTargets": {"tags": ["java-application"]}, "debug": {"configurationType": "java"}},
{"id": "main", "source": "provider", "entrypoints": true, "debug": {"configurationType": "java"}}
]
}
],
Expand Down
30 changes: 30 additions & 0 deletions scripts/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,35 @@ async function prepareRuns(signal) {
assert.ok(debug.arguments.indexOf("-cp") > debug.arguments.findIndex((argument) => argument.startsWith("-agentlib:jdwp")));
});

await check("Debug prepares an ordinary application on the host's JDWP port", async () => {
const application = buildSystem.run.find((run) => run.id === "application");
assert.equal(application.execution ?? "application", "application");
assert.equal(application.debug?.configurationType, "java");
const plan = await prepare({ name: "Main", path: "app", tags: ["java-application"], properties: { mainClass: "demo.app.Main" } }, {
launchOptions: { execution: application.execution ?? "application", runtimeArguments: ["-Dfixture=enabled"], arguments: ["fixture"], environment: { LITHE_FIXTURE: "set" },
workingDirectory: "app", debug: { adapterID: "dev.example/java", configurationType: application.debug.configurationType,
target: { kind: "connection", host: "127.0.0.1", port: 51236 } } },
});
assert.equal(plan.workingDirectory, "app");
assert.deepEqual(plan.environment, { LITHE_FIXTURE: "set" });
assert.ok(plan.arguments.includes("-Dfixture=enabled"));
assert.ok(plan.arguments.includes("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:51236"));
assert.deepEqual(plan.arguments.slice(plan.arguments.indexOf("-cp") + 2), ["demo.app.Main", "fixture", "typed"]);
});

await check("Debug prepares a source entrypoint without a named target", async () => {
const main = buildSystem.run.find((run) => run.entrypoints);
assert.equal(main.debug?.configurationType, "java");
const plan = await request({ path: "app", tags: [] }, {
run: main.id, target: undefined, userArguments: [],
launchOptions: { execution: "application", runtimeArguments: [], arguments: ["fixture"], environment: {},
entrypoint: "demo.app.Main", debug: { adapterID: "dev.example/java", configurationType: main.debug.configurationType,
target: { kind: "connection", host: "127.0.0.1", port: 51237 } } },
});
assert.ok(plan.arguments.includes("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:51237"));
assert.deepEqual(plan.arguments.slice(plan.arguments.indexOf("-cp") + 2), ["demo.app.Main", "fixture"]);
});

await check("a failed build ends preparation with the provider's error", async () => {
writeFileSync(join(root, "service", "src", "main", "java", "demo", "service", "Broken.java"), "package demo.service; class Broken {");
try {
Expand Down Expand Up @@ -424,6 +453,7 @@ async function test(signal) {
assert.ok(buildSystem.run.every((run) => run.source === "provider"));
assert.equal(runs.main.entrypoints, true, "Run on Current File starts any main class through the main run");
assert.equal(manifest.requires.buildProviders, 1);
assert.equal(manifest.requires.buildSystems, 2);
});

const projectDependencies = await document("read project dependencies", buildSystem.dependencies, signal, { project: "app" });
Expand Down
Loading