-
Notifications
You must be signed in to change notification settings - Fork 0
Build restructuring #9
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2d05edf
build: refactoring and renaming
matrei 42f134c
chore: whitespace
matrei 00c2812
build: rename app-debug to app-run
matrei 843c749
build: refactor code coverage
matrei eca597f
build: extract code coverage from testing
matrei 64a9bf2
ci: update workflows
matrei 358cd06
build: fix code coverage aggregation
matrei fd5e95f
ci: setup conditional build scans
matrei 9bfc3f1
ci: clean up post-release
matrei acffb26
docs: update readme and other md files
matrei d087969
build: add `org.junit.jupiter:junit-jupiter-api` for Gradle 9
matrei 0787a27
fix: remove redundant plugin Application class
matrei 5154fe7
docs: update titles in readme
matrei 18b0565
build: update code coverage aggregation
matrei 6dafe31
build: update code coverage aggregation
matrei 597bbbe
build: try and generalize publishing
matrei fc3f243
chore: add matrei as developer
matrei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| pluginManager.withPlugin('org.springframework.boot') { | ||
| tasks.named('bootRun', JavaExec) { | ||
| doFirst { | ||
| if (project.hasProperty('debugWait')) { | ||
| jvmArgs('-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005') | ||
| } | ||
| if (project.hasProperty('debug')) { | ||
| jvmArgs('-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005') | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import java.nio.charset.StandardCharsets | ||
|
|
||
| plugins { | ||
| id 'groovy' | ||
| } | ||
|
|
||
| tasks.withType(JavaCompile).configureEach { | ||
| options.with { | ||
| compilerArgs.add('-parameters') | ||
| encoding = StandardCharsets.UTF_8.name() | ||
| fork = true | ||
| incremental = true | ||
| release.set(resolveSdkmanJavaMajor(project)) | ||
| } | ||
| options.forkOptions.with { | ||
| jvmArgs.add('-Xmx1g') | ||
| memoryMaximumSize = '1g' | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(GroovyCompile).configureEach { | ||
| options.with { | ||
| compilerArgs.add('-parameters') | ||
| encoding = StandardCharsets.UTF_8.name() | ||
| fork = true | ||
| incremental = true | ||
| } | ||
| groovyOptions.with { | ||
| encoding = StandardCharsets.UTF_8.name() | ||
| optimizationOptions.indy = false | ||
| parameters = true | ||
| } | ||
| groovyOptions.forkOptions.with { | ||
| memoryMaximumSize = '1g' | ||
| jvmArgs.add('-Xmx1g') | ||
| } | ||
| } | ||
|
|
||
| private static Provider<Integer> resolveSdkmanJavaMajor(Project project) { | ||
| project.providers.provider { | ||
| def sdkmanrc = project.rootProject.file('.sdkmanrc') | ||
| if (!sdkmanrc.exists()) { | ||
| throw new GradleException('Missing .sdkmanrc in root project') | ||
| } | ||
|
|
||
| def props = new Properties() | ||
| sdkmanrc.withInputStream { props.load(it) } | ||
|
|
||
| def raw = props.getProperty('java')?.trim() | ||
| if (!raw) { | ||
| throw new GradleException('Missing java version in root project .sdkmanrc') | ||
| } | ||
|
|
||
| def major = raw.tokenize('.').first() | ||
| if (!(major ==~ /\d+/)) { | ||
| throw new GradleException( | ||
| "Invalid java version '$raw' in root project .sdkmanrc (major '$major' is not an integer)" | ||
| ) | ||
| } | ||
|
|
||
| return major.toInteger() | ||
|
|
||
| } as Provider<Integer> | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| def docProject = provider { | ||
| project(":${project.name - 'root'}docs") | ||
| } | ||
| def pluginProject = provider { | ||
| project(":${project.name - '-root'}") | ||
| } | ||
|
|
||
| tasks.register('cleanDocs', Delete) { | ||
| description = 'Deletes the documentation output' | ||
| group = 'documentation' | ||
|
|
||
| delete(rootProject.layout.projectDirectory.dir('build/docs')) | ||
| } | ||
|
|
||
| tasks.register('aggregateGroovyApiDoc', Groovydoc) { | ||
| description = 'Generates Groovy API Documentation for the plugin project under build/docs/gapi' | ||
| group = 'documentation' | ||
|
|
||
| def upstream = pluginProject.flatMap { | ||
| it.tasks.named('groovydoc', Groovydoc) | ||
| } as Provider<Groovydoc> | ||
|
|
||
| dependsOn(tasks.named('cleanDocs')) | ||
| dependsOn(upstream) | ||
|
|
||
| access = GroovydocAccess.PROTECTED | ||
| includeAuthor = false | ||
| includeMainForScripts = true | ||
| processScripts = true | ||
| exclude('**/Application.groovy') | ||
|
|
||
|
|
||
| source = { upstream.get().source } | ||
| destinationDir = rootProject.layout.buildDirectory.dir('docs/gapi').get().asFile | ||
| classpath = files({ upstream.get().classpath }) | ||
| groovyClasspath = files({ upstream.get().groovyClasspath }) | ||
| } | ||
|
|
||
| tasks.register('docs') { | ||
| description = 'Generates the documentation' | ||
| group = 'documentation' | ||
|
|
||
| dependsOn( | ||
| 'aggregateGroovyApiDoc', | ||
| docProject.get().tasks.named('asciidoctor') | ||
| ) | ||
| finalizedBy( | ||
| 'copyAsciiDoctorDocs', | ||
| 'ghPagesRootIndexPage' | ||
| ) | ||
| } | ||
|
|
||
| tasks.register('copyAsciiDoctorDocs', Copy) { | ||
| group = 'documentation' | ||
|
|
||
| from(docProject.flatMap { it.layout.buildDirectory }) | ||
| into(rootProject.layout.buildDirectory) | ||
| include('docs/**') | ||
| includeEmptyDirs = false | ||
|
|
||
| dependsOn('docs') | ||
| } | ||
|
|
||
| tasks.register('ghPagesRootIndexPage', Copy) { | ||
| description = 'Provides a root index page for historical versions that are currently managed manually' | ||
| group = 'documentation' | ||
|
|
||
| from(docProject.map { it.layout.projectDirectory.file('src/docs/index.tmpl') }) | ||
| into(rootProject.layout.buildDirectory.dir('docs')) | ||
| rename('index.tmpl', 'ghpages.html') | ||
|
|
||
| dependsOn('docs') | ||
| } | ||
|
|
6 changes: 3 additions & 3 deletions
6
...rails.plugins.servertiming.example.gradle → ...src/main/groovy/config.example-app.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| plugins { | ||
| id 'config.grails-assets' | ||
| id 'config.app-debug' | ||
| id 'org.apache.grails.gradle.grails-web' | ||
| id 'org.apache.grails.gradle.grails-gsp' | ||
| id 'org.grails.plugins.servertiming.assets' | ||
| id 'org.grails.plugins.servertiming.run' | ||
| } | ||
| } |
14 changes: 8 additions & 6 deletions
14
...grails.plugins.servertiming.assets.gradle → ...c/main/groovy/config.grails-assets.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this because intellij didn't detect the scope? With the asset plugin defined in the same file, this seems unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was the reason. I can revert it if you like it better the DSL way.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just worried about consistency. It's a shame that IntelliJ seems to always half implements this stuff. What are other people's thoughts? @jamesfredley @sbglasius
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to go ahead and merge this, if @jamesfredley or @sbglasius has any feedback on this we can address later.