-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
254 additions
and
99 deletions.
There are no files selected for viewing
This file contains 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 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,158 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY') | ||
ext."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE') | ||
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : ("${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg") | ||
ext.isReleaseVersion = !projectVersion.endsWith("SNAPSHOT") | ||
|
||
version projectVersion | ||
group "org.graceframework.plugins" | ||
|
||
apply plugin: "eclipse" | ||
apply plugin: "idea" | ||
apply plugin: "groovy" | ||
apply plugin: "org.graceframework.asset-pipeline" | ||
apply plugin: "org.graceframework.grace-plugin" | ||
apply plugin: "org.graceframework.grace-gsp" | ||
apply plugin: "maven-publish" | ||
apply plugin: "signing" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compileOnly "org.springframework.boot:spring-boot-autoconfigure" | ||
compileOnly "org.graceframework:grace-core" | ||
compileOnly "org.graceframework:grace-plugin-controllers" | ||
compileOnly "org.graceframework:grace-plugin-dynamic-modules" | ||
compileOnly "org.graceframework:grace-plugin-gsp" | ||
implementation "org.apache.commons:commons-lang3:3.12.0" | ||
profile "org.graceframework.profiles:web-plugin" | ||
} | ||
|
||
tasks.withType(Sign) { | ||
onlyIf { isReleaseVersion } | ||
} | ||
|
||
tasks.withType(GroovyCompile) { | ||
configure(groovyOptions) { | ||
forkOptions.jvmArgs = ['-Xmx1024m'] | ||
} | ||
} | ||
|
||
tasks.withType(Test) { | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.withType(org.grails.gradle.plugin.web.gsp.GroovyPageForkCompileTask) { | ||
packageName = 'admin.console' | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
jar { | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
manifest.mainAttributes( | ||
"Built-By": System.properties['user.name'], | ||
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")", | ||
"Implementation-Title": "Grace Admin Plugin", | ||
"Implementation-Version": projectVersion, | ||
"Implementation-Vendor": 'Grace Plugins') | ||
enabled = true | ||
archiveClassifier.set('') | ||
includeEmptyDirs = false | ||
} | ||
|
||
assets { | ||
packagePlugin = true | ||
} | ||
|
||
bootJar.enabled = false | ||
bootRun.enabled = false | ||
findMainClass.enabled = false | ||
shell.enabled = false | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
groupId = project.group | ||
artifactId = projectName | ||
version = project.version | ||
|
||
versionMapping { | ||
usage('java-api') { | ||
fromResolutionOf('runtimeClasspath') | ||
} | ||
usage('java-runtime') { | ||
fromResolutionResult() | ||
} | ||
} | ||
|
||
from components.java | ||
|
||
pom { | ||
name = "Grace Admin Plugin" | ||
description = "A powerful and flexible, extensible administration framework and management console for Grace." | ||
url = 'https://github.com/grace-plugins/grace-admin' | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'rainboyan' | ||
name = 'Michael Yan' | ||
email = 'rain@rainboyan.com' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com/grace-plugins/grace-admin.git' | ||
developerConnection = 'scm:git:ssh://github.com:grace-plugins/grace-admin.git' | ||
url = 'https://github.com/grace-plugins/grace-admin' | ||
} | ||
} | ||
|
||
pom.withXml { | ||
def pomNode = asNode() | ||
|
||
try { | ||
pomNode.dependencyManagement.replaceNode {} | ||
} catch (Throwable e) { | ||
// ignore | ||
} | ||
|
||
// simply remove dependencies without a version | ||
// version-less dependencies are handled with dependencyManagement | ||
// see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions | ||
pomNode.dependencies.dependency.findAll { | ||
it.version.text().isEmpty() | ||
}.each { | ||
try { | ||
it.replaceNode {} | ||
} catch (Throwable e) { | ||
// ignore | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
signing { | ||
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") } | ||
sign publishing.publications.maven | ||
} | ||
} |
Oops, something went wrong.