Last active
December 30, 2018 02:36
-
-
Save bjonnh/7f6737ff3d44b94914c0e7e1a69b7c59 to your computer and use it in GitHub Desktop.
Non Working Gradle build to bintray
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
import com.jfrog.bintray.gradle.BintrayExtension | |
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask | |
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | |
import org.gradle.api.publish.maven.MavenPom | |
import org.jetbrains.dokka.gradle.* | |
val kotlin_version = "1.3.11" | |
val rdf4j_version = "2.4.2" | |
plugins { | |
kotlin("jvm") version "1.3.11" | |
id("org.jetbrains.dokka") version "0.9.17" | |
`maven-publish` | |
`java-library` | |
id("com.jfrog.bintray") version "1.8.4" | |
id("com.github.johnrengelman.shadow") version "4.0.3" | |
} | |
group = "net.bjonnh" | |
version = "0.1-SNAPSHOT" | |
val artifactID = "rdf4k" | |
val publicationName = artifactID | |
repositories { | |
mavenCentral() | |
jcenter() | |
} | |
dependencies { | |
compile(kotlin("stdlib-jdk8", kotlin_version)) | |
compile(kotlin("reflect", kotlin_version)) | |
compile("org.eclipse.rdf4j", "rdf4j-bom", rdf4j_version) | |
compile("org.eclipse.rdf4j", "rdf4j-runtime", rdf4j_version) | |
compile("org.eclipse.rdf4j", "rdf4j-queryresultio-text", rdf4j_version) | |
compile("org.eclipse.rdf4j", "rdf4j-sparqlbuilder", rdf4j_version) | |
compile("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17") | |
} | |
tasks.withType<KotlinCompile> { | |
kotlinOptions.jvmTarget = "1.8" | |
} | |
val githubRepo = "https://github.com/bjonnh/rdf4k" | |
tasks.withType<DokkaTask> { | |
val src = "src/main" | |
val out = "$projectDir/docs" | |
doFirst { | |
println("Cleaning doc directory ${out}...") | |
project.delete(fileTree(out) { | |
exclude("logos/**", "templates/**") | |
}) | |
} | |
moduleName = "" | |
sourceDirs = files(src) | |
outputFormat = "html" | |
outputDirectory = out | |
skipEmptyPackages = true | |
jdkVersion = 8 | |
includes = listOf("README.md") | |
val mapping = LinkMapping().apply { | |
dir = src | |
url = "${githubRepo}/blob/master/$src" | |
suffix = "#L" | |
} | |
linkMappings = arrayListOf(mapping) | |
description = "Generate ${project.name} v$version docs in HTML." | |
doLast { | |
println("Generated HTML format docs to ${outputDirectory}") | |
} | |
} | |
publishing { | |
publications.invoke { | |
"BintrayRelease"(MavenPublication::class) { | |
from(components["java"]) | |
artifact(sourcesJar) | |
groupId = project.group.toString() | |
artifactId = project.name | |
version = project.version.toString() | |
} | |
} | |
} | |
tasks { | |
withType<BintrayUploadTask> { | |
dependsOn("build") | |
} | |
withType<KotlinCompile> { | |
kotlinOptions.jvmTarget = "1.8" | |
} | |
} | |
val sourcesJar by tasks.creating(Jar::class) { | |
classifier = "sources" | |
from(sourceSets["main"].allSource.sourceDirectories.files) | |
} | |
fun findProperty(s: String) = project.findProperty(s) as String? | |
bintray { | |
user = findProperty("bintrayUser") | |
key = findProperty("bintrayApiKey") | |
publish = false | |
setPublications("BintrayRelease") | |
pkg(delegateClosureOf<BintrayExtension.PackageConfig> { | |
repo = "RDF4K" | |
name = "RDF4K" | |
userOrg = "bjonnh" | |
websiteUrl = "https://www.github.com/bjonnh/rdf4k" | |
githubRepo = "bjonnh/rdf4k" | |
vcsUrl = "https://github.com/bjonnh/rdf4k" | |
description = "A wrapper around RDF4J for Kotlin." | |
setLabels("kotlin", "rdf4j", "linkeddata") | |
setLicenses("EPL-2.0", "GPL-3.0") | |
desc = description | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment