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

Support exporting jar #271

Merged
merged 48 commits into from
Jul 30, 2020
Merged

Support exporting jar #271

merged 48 commits into from
Jul 30, 2020

Conversation

CsCherrYY
Copy link
Contributor

Add 'getMainMethod' command in jdtls.ext, which will return all the existing main methods of the workspace.

@ghost
Copy link

ghost commented Jun 23, 2020

CLA assistant check
All CLA requirements met.

@jdneo jdneo added this to the 0.10.2 milestone Jun 24, 2020
jdneo
jdneo previously approved these changes Jun 24, 2020
Copy link
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdneo jdneo modified the milestones: 0.10.2, 0.11.0 Jul 6, 2020
@CsCherrYY CsCherrYY changed the title Add 'getMainMethod' command Support exporting jar Jul 16, 2020
Copy link
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @testforstephen has mentioned, there are several unnecessary files/code in this PR. Please remove them first. Also, remember add license header when you adding a new file.

jdtls.ext/target.target Outdated Show resolved Hide resolved
jdtls.ext/target.target Outdated Show resolved Hide resolved
package.nls.zh.json Outdated Show resolved Hide resolved
src/views/quickPickNode.ts Outdated Show resolved Hide resolved
src/views/projectPickNode.ts Outdated Show resolved Hide resolved
@clankill3r
Copy link

Hi, this seams great.
Can you briefly explain how this exporting to a jar will work from a user perspective?

@CsCherrYY
Copy link
Contributor Author

Hi, this seams great.
Can you briefly explain how this exporting to a jar will work from a user perspective?

We will put an export jar button on the title of the Java Projects explorer. It will guide you to export your java project into a (runnable) jar with some necessary steps, such as choosing main method and dependencies.

src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
case ExportSteps.ResolveProject: {
projectFolder = await resolveProject(pickSteps, node);
projectUri = Uri.parse(projectFolder);
rootNodes = await Jdtls.getProjects(projectUri.toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is rootNode here meaning a project node?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly. For maven project as an example, rootNodes is an Array which includes all the modules defined in pom.xml.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodules are still projects. rootNode is misleading here, what is root? is it workspace root? And what is node? we don't have tree structure here

src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/commands.ts Show resolved Hide resolved
src/commands.ts Outdated Show resolved Hide resolved
java.view.package.exportJar ->
java.view.package.generateJar
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarSteps/GenerateJarStep.ts Outdated Show resolved Hide resolved
src/exportJarSteps/IStep.ts Outdated Show resolved Hide resolved
src/views/dependencyDataProvider.ts Show resolved Hide resolved
src/exportJarSteps/ResolveMainMethodStep.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
}, (progress, token) => {
return new Promise<IJarQuickPickItem[]>(async (resolve, reject) => {
token.onCancellationRequested(() => {
return reject();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return resolve([])

src/exportJarSteps/StepGenerateJar.ts Outdated Show resolved Hide resolved
src/exportJarSteps/StepGenerateJar.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
try {
step = await stepMap.get(step).execute(stepMetadata);
} catch (err) {
if (err === undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return err ? reject(${err}) : reject()

}
const disposables: Disposable[] = [];
let pickBox: QuickPick<IJarQuickPickItem>;
const result = await new Promise<boolean>(async (resolve, reject) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try {
} finally {}

1.Fix disposables bugs
2.move stepMap to grobal
src/exportJarFileCommand.ts Outdated Show resolved Hide resolved
Copy link
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdneo jdneo merged commit 23afff6 into microsoft:master Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants