ManifestEditor/build.gradle

133 lines
3.4 KiB
Groovy
Raw Permalink Normal View History

plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id 'maven-publish'
2020-02-27 03:46:54 +00:00
}
// Set version of programm
def version = "1.1.0"
2020-02-27 03:46:54 +00:00
group = "com.wind.meditor.ManifestEditorMain"
2020-02-27 03:46:54 +00:00
sourceCompatibility = 11
targetCompatibility = 11
// Set correct encoding
compileJava.options.encoding = 'UTF-8'
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
// create a single .jar with all dependencies //
task fatJar(type: Jar) {
archiveClassifier = ''
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes( 'Main-Class': 'com.wind.meditor.ManifestEditorMain',
'Implementation-Version': version )
}
manifest {
attributes( 'Implementation-Title': 'ManifestEditor',
'Implementation-Version': version,
'Implementation-Group': project.group, )
}
archivesBaseName = "ManifestEditor"
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
{
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
2020-02-27 03:46:54 +00:00
}
with jar
destinationDirectory.set(layout.buildDirectory.dir("dist"))
}
2020-02-27 03:46:54 +00:00
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
destinationDirectory.set(layout.buildDirectory.dir("dist"))
}
2020-02-27 03:46:54 +00:00
task javadocJar(type: Jar, dependsOn: javadoc) {
manifest {
attributes( 'Implementation-Title': 'ManifestEditor',
'Implementation-Version': version,
'Implementation-Group': project.group, )
2020-02-27 03:46:54 +00:00
}
archiveClassifier = 'javadoc'
from javadoc.destinationDir
destinationDirectory.set(layout.buildDirectory.dir("dist"))
}
2020-02-27 03:46:54 +00:00
artifacts {
archives sourcesJar
archives javadocJar
archives fatJar
}
// publish to local maven repo //
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'ManifestEditor'
from components.java
pom {
name = 'Manifest Editor'
description = 'A manifest editor for android'
url = 'https://git.rpjosh.de/RPJosh/RPdb'
licenses {
license {
name = 'The GNU AFFERO GENERAL PUBLIC LICENSE, Version 3'
url = 'https://www.gnu.org/licenses/agpl-3.0.html'
}
}
developers {
developer {
id = 'RPJosh'
name = 'RPJosh'
email = 'RPjosh@rpjosh.de'
}
}
}
2020-02-27 03:46:54 +00:00
}
}
}
repositories {
mavenCentral()
}
dependencies {
// Logging library
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.3.0-alpha16'
// Rest service
implementation group: 'com.squareup.retrofit2', name: 'retrofit', version: '2.9.0'
implementation group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.9.0'
// Configuration file (.ini)
implementation group: 'org.ini4j', name: 'ini4j', version: '0.5.4'
}
tasks.named('jar') {
manifest {
attributes( 'Implementation-Title': 'ManifestEditor',
'Implementation-Version': version,
'Implementation-Group': 'com.wind.meditor.ManifestEditorMain', )
}
}