Skip to content

Commit

Permalink
build: add missing code (#784)
Browse files Browse the repository at this point in the history
* build: add missing code

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

* build: work in progress

---------

Co-authored-by: khalilou88 <[email protected]>
  • Loading branch information
khalilou88 and khalilou88 authored Jan 22, 2024
1 parent 48bf823 commit daf4ca6
Show file tree
Hide file tree
Showing 19 changed files with 321 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/plugin-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
- nx-maven quarkus bom e2e
- nx-maven spring-boot bom e2e
- nx-maven spring-boot-parent-pom e2e
- should create a micronaut java application
- should create a sb java application
os:
type: choice
description: Os
Expand Down
3 changes: 3 additions & 0 deletions DEV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nx local-registry

nx run-many --targets publish --ver 0.0.0-e2e --tag e2e
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"nx": "17.2.8",
"prettier": "^3.1.1",
"prettier-plugin-java": "^2.5.0",
"smol-toml": "^1.1.3",
"tcp-port-used": "^1.0.2",
"tmp": "^0.2.1",
"tree-kill": "1.2.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/nx-gradle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@jnxplus/common": "0.18.5",
"nx": ">=17.0.0",
"tslib": "^2.6.2",
"@nx/devkit": ">=17.0.0"
"@nx/devkit": ">=17.0.0",
"smol-toml": "^1.1.3"
}
}
9 changes: 9 additions & 0 deletions packages/nx-gradle/src/generators/application/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
getVersionManagement,
} from '../../utils';
import { NxGradleAppGeneratorSchema } from './schema';
import { addMissingCode } from '../../utils/libs-versions-toml';

export default async function (
tree: Tree,
Expand Down Expand Up @@ -324,6 +325,14 @@ async function applicationGenerator(
) {
const normalizedOptions = normalizeOptions(tree, options);

await addMissingCode(
tree,
normalizedOptions.versionManagement,
normalizedOptions.gradleRootDirectory,
options.framework,
options.language,
);

const projectConfiguration: ProjectConfiguration = {
root: normalizedOptions.projectRoot,
projectType: 'application',
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ plugins {
alias libs.plugins.github.khalilou88.jnxplus
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias libs.plugins.jetbrains.kotlin.jvm apply false
<% } -%>
<% if(dsl === 'kotlin') { -%>
alias(libs.plugins.github.khalilou88.jnxplus)
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
<% } -%>
}
<% } -%>
10 changes: 6 additions & 4 deletions packages/nx-gradle/src/generators/init/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
writeJson,
} from '@nx/devkit';
import * as path from 'path';
import { addLibsVersionsToml } from '../../utils/libs-versions-toml';
import { NxGradleInitGeneratorSchema } from './schema';

interface NormalizedSchema extends NxGradleInitGeneratorSchema {
Expand Down Expand Up @@ -86,11 +87,12 @@ function addFiles(tree: Tree, options: NormalizedSchema) {
);

if (options.versionManagement === 'version-catalog') {
generateFiles(
addLibsVersionsToml(
tree,
path.join(__dirname, 'files', 'gradle', 'catalog', options.preset),
joinPathFragments(options.gradleRootDirectory, 'gradle'),
templateOptions,
options.gradleRootDirectory,
options.javaVersion,
options.preset,
'java',
);
}
}
Expand Down
9 changes: 9 additions & 0 deletions packages/nx-gradle/src/generators/library/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
getVersionManagement,
} from '../../utils';
import { NxGradleLibGeneratorSchema } from './schema';
import { addMissingCode } from '../../utils/libs-versions-toml';

export default async function (
tree: Tree,
Expand Down Expand Up @@ -276,6 +277,14 @@ async function libraryGenerator(
) {
const normalizedOptions = normalizeOptions(tree, options);

await addMissingCode(
tree,
normalizedOptions.versionManagement,
normalizedOptions.gradleRootDirectory,
options.framework,
options.language,
);

const projectConfiguration: ProjectConfiguration = {
root: normalizedOptions.projectRoot,
projectType: 'library',
Expand Down
Loading

0 comments on commit daf4ca6

Please sign in to comment.