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

feat(gradle): gradle atomizer #26663

Merged

Conversation

xiongemi
Copy link
Collaborator

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

Copy link

vercel bot commented Jun 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jul 5, 2024 1:54pm

@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch 7 times, most recently from b0d072c to 165ea74 Compare June 26, 2024 20:32
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch from 165ea74 to 4e71af1 Compare June 27, 2024 02:36
@xiongemi xiongemi requested a review from a team as a code owner June 27, 2024 02:36
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch from 4e71af1 to 985e712 Compare June 27, 2024 05:30
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch from 985e712 to 9ae5588 Compare June 28, 2024 17:17
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch from 9ae5588 to 289bbba Compare June 28, 2024 19:28
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch from 289bbba to b9ad060 Compare June 28, 2024 19:47
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch from b9ad060 to 0357401 Compare June 28, 2024 20:05
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch 3 times, most recently from 22f5a04 to 192d5cb Compare July 5, 2024 02:13
@xiongemi xiongemi force-pushed the feature/nxc-736-implement-atomizing-gradle-test-targets branch from 9438420 to a6484f9 Compare July 5, 2024 13:46
@@ -58,6 +58,7 @@ function addPlugin(tree: Tree) {
plugin: '@nx/gradle',
options: {
testTargetName: 'test',
ciTargetName: 'test-ci',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't do this yet. It can be enabled manually for now.

testTargetName?: string;
classesTargetName?: string;
buildTargetName?: string;
[taskTargetName: string]: string | undefined;
}

function normalizeOptions(options: GradlePluginOptions): GradlePluginOptions {
options ??= {};
options.ciTargetName ??= 'test-ci';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't set this by default. It should be the same as jest where we don't set it by default, but people can update their nx.json manually.

const inputsMap = createInputsMap(context);

const targets: Record<string, TargetConfiguration> = {};
const targetGroups: Record<string, string[]> = {};
for (const task of tasks) {
const targetName = options?.[`${task.name}TargetName`] ?? task.name;

const outputs = outputDirs.get(task.name);
if (task.name === 'test') {
const testFiles = await globWithWorkspaceContext(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this inside getTestTargets

}
targetGroups[taskType].push(testTargetName);

if (!testFiles || testFiles.length === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will need a check for if they have ciTargetName. If not, don't glob and don't add targets. If yes, glob and add targets.

dependsOn: dependsOnMap['test'],
metadata: {
technologies: ['gradle'],
description: `Runs Gradle Tests ${testName} in CI`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description: `Runs Gradle Tests ${testName} in CI`,
description: `Runs tests for the ${testName} class`,

@FrozenPandaz FrozenPandaz merged commit 62baf4f into master Jul 5, 2024
6 checks passed
@FrozenPandaz FrozenPandaz deleted the feature/nxc-736-implement-atomizing-gradle-test-targets branch July 5, 2024 19:22
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants