You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where build.gradle.kts is defined in the buildSrc directory. I want to keep this structure so that the build.gradle.kts configurations are centralized and not polluted on the project root directory.
With this structure, the gradle project is not included in nx project graph. Take note that i have project-report plugin configured. Running ./gradlew projectReport works and builds the projectReport.
The issue stems from packages/gradle/src/utils/get-project-report-lines.ts
// if there is no build.gradle or build.gradle.kts file, we cannot run the projectReport nor projectReportAll task
if (
!existsSync(join(dirname(gradlewFile), 'build.gradle')) &&
!existsSync(join(dirname(gradlewFile), 'build.gradle.kts'))
) {
logger.warn(
`Could not find build file near ${gradlewFile}. Please run 'nx generate @nx/gradle:init' to generate the necessary tasks.`
);
return [];
}
Which presumes a specific location of the build.gradle file. Adding even an empty build.gradle.kts file on the root "solves" the issue. But currently unsure if this check can be removed - since the succeeding lines would already handle gracefully if projectReport or projectReportAll task is not configured - regardless of where build.gradle file is located.
Expected Behavior
Currently expecting nx/gradle to work for any properly configured gradle project.
The current implementation seems to have a specific project structure defined to properly cross-work with gradle projects. I presumed that nx/gradle would only require having a gradle task for projectReport or projectReportAll defined - e.g. such that when running ./gradlew projectReport works, nx should be able to use this tool to build the nx graph. The current code seems to be over-specified in that the location of the build.gradle file must be on the same path of the directory where the gradlew file resides.
No failure logs, but nx graph not properly built. Gradle apps not loaded in nx context.
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
Not sure if fix is to remove path check for build.gradle.kts, or include buildSrc directory as location of gradle configs. Seems like removing the check will already work because of the succeeding try catch handling should already cover if there is no gradle task configured for projectReport or projectReportAll.
The text was updated successfully, but these errors were encountered:
Current Behavior
I have an pre-existing gradle multi-project having this structure:
Where
build.gradle.kts
is defined in thebuildSrc
directory. I want to keep this structure so that the build.gradle.kts configurations are centralized and not polluted on the project root directory.With this structure, the gradle project is not included in nx project graph. Take note that i have
project-report
plugin configured. Running./gradlew projectReport
works and builds the projectReport.The issue stems from
packages/gradle/src/utils/get-project-report-lines.ts
Which presumes a specific location of the build.gradle file. Adding even an empty
build.gradle.kts
file on the root "solves" the issue. But currently unsure if this check can be removed - since the succeeding lines would already handle gracefully if projectReport or projectReportAll task is not configured - regardless of where build.gradle file is located.Expected Behavior
Currently expecting nx/gradle to work for any properly configured gradle project.
The current implementation seems to have a specific project structure defined to properly cross-work with gradle projects. I presumed that nx/gradle would only require having a gradle task for
projectReport
orprojectReportAll
defined - e.g. such that when running./gradlew projectReport
works, nx should be able to use this tool to build the nx graph. The current code seems to be over-specified in that the location of the build.gradle file must be on the same path of the directory where the gradlew file resides.GitHub Repo
https://github.com/romanbalayan/gradle-demo
Steps to Reproduce
./gradlew projectReport
to demonstrate projectReport task is configured./nx graph
- gradle projects will not be loaded into nx graphtouch build.gradle.kts
- to build an empty build.gradle file./nx graph
- gradle projects - demo-app and demo-lib will now be loadedNx Report
Failure Logs
No failure logs, but nx graph not properly built. Gradle apps not loaded in nx context.
Package Manager Version
No response
Operating System
Additional Information
Not sure if fix is to remove path check for
build.gradle.kts
, or includebuildSrc
directory as location of gradle configs. Seems like removing the check will already work because of the succeeding try catch handling should already cover if there is no gradle task configured for projectReport or projectReportAll.The text was updated successfully, but these errors were encountered: