Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched to kotlin #50

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 0 additions & 153 deletions build.gradle

This file was deleted.

154 changes: 154 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
plugins {
// Main gradle plugin for building a Java library
id("java-library")
id("maven-publish")
// To create a shadow/fat jar that bundle up all dependencies
id("com.github.johnrengelman.shadow") version "8.1.1"
// Add JavaFX dependencies
alias(libs.plugins.javafx)
// Version in settings.gradle
id("org.bytedeco.gradle-javacpp-platform")
}

extra["moduleName"] = "qupath.extension.omero"
version = "0.1.1-rc1"
description = "QuPath extension to support image reading using OMERO APIs."
group = "io.github.qupath"
extra["qupathVersion"] = gradle.extra["qupathVersion"]
extra["qupathJavaVersion"] = libs.versions.jdk.get()

dependencies {
shadow("io.github.qupath:qupath-gui-fx:${project.extra["qupathVersion"]}")
shadow("io.github.qupath:qupath-extension-bioformats:${project.extra["qupathVersion"]}")
shadow(libs.qupath.fxtras)
shadow(libs.guava)

shadow(libs.slf4j)

// Auto-discover if OMERO-Gateway is available
shadow("org.openmicroscopy:omero-gateway:5.8.2")

testImplementation("io.github.qupath:qupath-gui-fx:${project.extra["qupathVersion"]}")
testImplementation("io.github.qupath:qupath-extension-bioformats:${project.extra["qupathVersion"]}")
testImplementation("org.openmicroscopy:omero-gateway:5.8.2")
testImplementation(libs.junit)
testImplementation("org.testcontainers:testcontainers:1.19.1")
testImplementation("org.testcontainers:junit-jupiter:1.19.1")
}

tasks.withType<Jar> {
manifest {
attributes(mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to archiveVersion,
"Automatic-Module-Name" to project.extra["moduleName"]
))
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(project.extra["qupathJavaVersion"] as String))
}
withSourcesJar()
withJavadocJar()
}

/**
* Copy necessary attributes, see
* - https://github.com/qupath/qupath-extension-template/issues/9
* - https://github.com/openjfx/javafx-gradle-plugin#variants
*/
configurations.shadow {
val runtimeAttributes = configurations.runtimeClasspath.get().attributes
runtimeAttributes.keySet().forEach { key ->
attributes.attribute(key as Attribute<Any>, runtimeAttributes.getAttribute(key) as Any)
}
}

tasks.processResources {
from ("${projectDir}/LICENSE") {
into("licenses/")
}
}

tasks.register<Copy>("copyDependencies") {
description = "Copy dependencies into the build directory for use elsewhere"
group = "QuPath"

from(configurations.default)
into("build/libs")
}

tasks.withType<Javadoc> {
options.encoding = "UTF-8"
if (findProperty("strictJavadoc") == null) {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
}
}

tasks.named<JavaCompile>("compileJava") {
options.encoding = "UTF-8"
}

tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

tasks.named<Test>("test") {
useJUnitPlatform()
}

repositories {
mavenCentral()

maven {
url = uri("https://maven.scijava.org/content/repositories/releases")
}

maven {
url = uri("https://maven.scijava.org/content/repositories/snapshots")
}

maven {
name = "ome.maven"
url = uri("https://artifacts.openmicroscopy.org/artifactory/maven")
}

maven {
name = "unidata.releases<"
url = uri("https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases")
}
}

publishing {
repositories {
maven {
name = "SciJava"
val releasesRepoUrl = uri("https://maven.scijava.org/content/repositories/releases")
val snapshotsRepoUrl = uri("https://maven.scijava.org/content/repositories/snapshots")
// Use gradle -Prelease publish
url = if (project.hasProperty("release")) releasesRepoUrl else snapshotsRepoUrl
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}

publications {
create<MavenPublication>("mavenJava") {
from(components["java"])

pom {
licenses {
license {
name = "Apache License v2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0"
}
}
}
}
}
}

31 changes: 0 additions & 31 deletions settings.gradle

This file was deleted.

30 changes: 30 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pluginManagement {
plugins {
kotlin("org.bytedeco.gradle-javacpp-platform") version "1.5.9"
}
}

rootProject.name = "qupath-extension-omero"

extra["qupathVersion"] = "0.6.0-SNAPSHOT"

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from("io.github.qupath:qupath-catalog:${extra["qupathVersion"]}")
}
}

repositories {
mavenCentral()

maven {
url = uri("https://maven.scijava.org/content/repositories/releases")
}

maven {
url = uri("https://maven.scijava.org/content/repositories/snapshots")
}

}
}
Loading