-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded gradle to 8.11 and simplified gradle configuration
- Loading branch information
Showing
17 changed files
with
264 additions
and
216 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* Copyright (C) 2024 Document Node Pty Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
plugins { | ||
alias(libs.plugins.axion.release) | ||
} | ||
|
||
allprojects { | ||
group = 'io.documentnode' | ||
project.version = rootProject.version | ||
} | ||
|
||
subprojects { | ||
// Apply the java-library plugin for API and implementation separation. | ||
apply plugin: "java-library" | ||
apply plugin: "java" | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
} | ||
|
||
def javaVersion = JavaVersion.VERSION_11 | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(javaVersion.toString()) | ||
} | ||
} | ||
task enforceVersion { | ||
doLast { | ||
def foundVersion = JavaVersion.current() | ||
if (foundVersion != javaVersion) | ||
throw new IllegalStateException("Wrong Java version; required is " | ||
+ javaVersion + ", but found " + foundVersion) | ||
} | ||
} | ||
compileJava.dependsOn(enforceVersion) | ||
|
||
dependencies { | ||
implementation libs.dn.minilog | ||
|
||
// Don't use the traditional logging framework to make it easier | ||
// for creating a native shared library (smaller) | ||
// implementation("org.slf4j:slf4j-api:1.8.0-beta4") | ||
// implementation("org.slf4j:slf4j-simple:1.8.0-beta4") | ||
|
||
// Use JUnit for testing | ||
testImplementation libs.junit4 | ||
testImplementation libs.mockito.core | ||
} | ||
|
||
tasks.named('test') { | ||
// Use JUnit for unit tests. | ||
useJUnit() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
buildSrc/src/main/kotlin/io.documentnode.epub4j.java-application-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
buildSrc/src/main/kotlin/io.documentnode.epub4j.java-common-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
buildSrc/src/main/kotlin/io.documentnode.epub4j.java-library-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
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,109 @@ | ||
/* | ||
* For more details on writing Custom Plugins, please refer to | ||
* https://docs.gradle.org/8.10.2/userguide/custom_plugins.html in the | ||
* Gradle documentation. | ||
*/ | ||
|
||
plugins { | ||
id 'signing' | ||
id 'maven-publish' | ||
|
||
alias(libs.plugins.gversion) | ||
} | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation libs.kxml2 | ||
implementation libs.xmlpull | ||
api libs.zip4j | ||
} | ||
|
||
gversion { | ||
// path is relative to the sub-project by default | ||
// Gradle variables can also be used | ||
// E.g. "${project.rootDir}/module/src/main/java" | ||
srcDir = "src/main/java/" | ||
classPackage = "io.documentnode.epub4j.util" | ||
// optional. If not specified GVersion is used | ||
className = "GVersion" | ||
// optional. This is the default | ||
dateFormat = "yyyy-MM-dd'T'HH:mm:ss z"; | ||
// optional. UTC is default | ||
timeZone = "UTC" | ||
// optional. print out extra debug information | ||
debug = false | ||
// optional. Can be Java or Kotlin, case insensitive | ||
language = "java" | ||
// optional. Force types to be explicitly printed | ||
explicitType = false | ||
} | ||
project.compileJava.dependsOn(createVersionFile) | ||
|
||
signing { | ||
sign publishing.publications | ||
} | ||
|
||
// Disable signing tasks in CI | ||
tasks.withType(Sign).configureEach { | ||
onlyIf { | ||
// Skip signing if running in CI | ||
!System.getenv("CI") | ||
} | ||
} | ||
|
||
def ossrU = project.hasProperty("ossrhToken") ? ossrhToken : "" | ||
def ossrP = project.hasProperty("ossrhTokenPassword") ? ossrhTokenPassword : "" | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
groupId = 'io.documentnode' | ||
artifactId = 'epub4j' | ||
version = project.version | ||
pom { | ||
name = 'epub4j' | ||
description = 'A java library for reading/writing/manipulating EPUB files, with improvements based on epublib.' | ||
url = 'https://documentnode.io/epub4j' | ||
packaging = 'jar' | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'jiakuan' | ||
name = 'Jiakuan Wang' | ||
email = '[email protected]' | ||
organization = 'Document Node' | ||
organizationUrl = 'https://documentnode.io' | ||
} | ||
} | ||
|
||
scm { | ||
connection = 'scm:git:[email protected]:documentnode/epub4j.git' | ||
developerConnection = 'scm:git:[email protected]:documentnode/epub4j.git' | ||
url = 'https://github.com/documentnode/epub4j' | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
credentials { | ||
username = ossrU | ||
password = ossrP | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
plugins { | ||
id 'application' | ||
|
||
alias(libs.plugins.shadow) | ||
} | ||
|
||
dependencies { | ||
implementation project(':epub4j-core') | ||
|
||
implementation(libs.htmlcleaner) { | ||
exclude group: 'org.jdom', module: 'jdom' | ||
exclude group: 'org.apache.ant', module: 'ant' | ||
} | ||
implementation(libs.commons.vfs) | ||
implementation(libs.commons.lang) | ||
implementation(libs.commons.io) | ||
} | ||
|
||
application { | ||
mainClass = 'io.documentnode.epub4j.Fileset2Epub' | ||
} | ||
|
||
// Required by the 'shadowJar' task | ||
project.ext.mainClassName = "io.documentnode.epub4j.Fileset2Epub" | ||
|
||
tasks.withType(com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { | ||
manifest { | ||
attributes( | ||
"Implementation-Title": "Fileset2Epub Command Line Tool", | ||
// Uncomment and replace `version` with the actual version if needed | ||
// "Implementation-Version": version, | ||
"Main-Class": "io.documentnode.epub4j.Fileset2Epub" | ||
) | ||
} | ||
} |
Oops, something went wrong.