-
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.
Gradle: use org.javamodularity.moduleplugin.
- Loading branch information
Showing
3 changed files
with
116 additions
and
119 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 |
---|---|---|
@@ -1,15 +1,126 @@ | ||
plugins { | ||
id 'carte.java-conventions' | ||
id 'java-library' | ||
id 'maven-publish' | ||
id 'org.javamodularity.moduleplugin' version '1.8.6' apply false | ||
} | ||
|
||
group = 'io.sf.carte' | ||
|
||
description = 'carte-util' | ||
|
||
publishing.publications.maven(MavenPublication).pom { | ||
description = 'Carte utility library' | ||
version = '3.5.1' | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs = ['src'] | ||
includes += ["**/*.java"] | ||
} | ||
resources { | ||
srcDirs = ['src'] | ||
excludes += ["**/*.java"] | ||
} | ||
} | ||
test { | ||
java { | ||
srcDirs = ['junit'] | ||
includes += ["**/*.java"] | ||
} | ||
resources { | ||
srcDirs = ['junit'] | ||
excludes += ["**/*.java"] | ||
} | ||
} | ||
} | ||
|
||
version = '3.5.1' | ||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
modularity.inferModulePath = false | ||
} | ||
|
||
apply plugin: 'org.javamodularity.moduleplugin' | ||
|
||
modularity.mixedJavaRelease 8, 11 | ||
|
||
test.moduleOptions.runOnClasspath = true | ||
|
||
dependencies { | ||
testImplementation 'junit:junit:4.13.1' | ||
} | ||
|
||
repositories { | ||
maven { | ||
url = uri('https://repo.maven.apache.org/maven2/') | ||
} | ||
} | ||
|
||
tasks.register('lineEndingConversion', CRLFConvert) { | ||
description 'Convert LICENSE.txt to Windows line endings' | ||
file "$rootDir/LICENSE.txt" | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
tasks.withType(Javadoc) { | ||
failOnError false | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
options.addStringOption('encoding', 'UTF-8') | ||
options.addStringOption('charset', 'UTF-8') | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
from(components.java) | ||
pom { | ||
description = 'Carte utility library' | ||
url = "https://github.com/css4j/carte-util" | ||
licenses { | ||
license { | ||
name = "BSD 3-clause license" | ||
url = "https://css4j.github.io/LICENSE.txt" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = 'mavenRepo' | ||
/* | ||
* The following section applies to the 'publish' task: | ||
* | ||
* If you plan to deploy to a repository, please configure the | ||
* 'mavenReleaseRepoUrl' and/or 'mavenSnapshotRepoUrl' properties | ||
* (for example in GRADLE_USER_HOME/gradle.properties). | ||
* | ||
* Otherwise, Gradle shall create a 'build/repository' subdirectory | ||
* at ${rootDir} and deploy there. | ||
* | ||
* Properties 'mavenRepoUsername' and 'mavenRepoPassword' can also | ||
* be set (generally from command line). | ||
*/ | ||
def releasesUrl | ||
def snapshotsUrl | ||
if (project.hasProperty('mavenReleaseRepoUrl') && project.mavenReleaseRepoUrl) { | ||
releasesUrl = mavenReleaseRepoUrl | ||
} else { | ||
releasesUrl = "${rootDir}/build/repository/releases" | ||
} | ||
if (project.hasProperty('mavenSnapshotRepoUrl') && project.mavenSnapshotRepoUrl) { | ||
snapshotsUrl = mavenSnapshotRepoUrl | ||
} else { | ||
snapshotsUrl = "${rootDir}/build/repository/snapshots" | ||
} | ||
url = version.endsWith('-SNAPSHOT') ? snapshotsUrl : releasesUrl | ||
if (project.hasProperty('mavenRepoUsername') && | ||
project.hasProperty('mavenRepoPassword')) { | ||
credentials.username = mavenRepoUsername | ||
credentials.password = mavenRepoPassword | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.