[med-svn] [Git][med-team/milib][master] 7 commits: Removing files from debian/ we needed for Maven previously
Pierre Gruet (@pgt)
gitlab at salsa.debian.org
Fri Jul 1 22:19:26 BST 2022
Pierre Gruet pushed to branch master at Debian Med / milib
Commits:
88c6ddff by Pierre Gruet at 2022-07-01T23:15:47+02:00
Removing files from debian/ we needed for Maven previously
- - - - -
dc19b61f by Pierre Gruet at 2022-07-01T23:16:19+02:00
Refreshing dependencies
- - - - -
551dd602 by Pierre Gruet at 2022-07-01T23:16:39+02:00
Refreshing Maven rules
- - - - -
2797281d by Pierre Gruet at 2022-07-01T23:17:05+02:00
Patching build.gradle.kts to form a gradle build file
Also adding a small hack in d/rules to change its name
- - - - -
a23bbad2 by Pierre Gruet at 2022-07-01T23:18:06+02:00
Changing a call to a guava method
- - - - -
957b183c by Pierre Gruet at 2022-07-01T23:18:25+02:00
Deactivating a test relying on a build properties file we don't provide
- - - - -
8f0c1ba5 by Pierre Gruet at 2022-07-01T23:19:12+02:00
Updating changelog with TODO
- - - - -
13 changed files:
- − debian/README.source
- debian/changelog
- debian/control
- − debian/maven.cleanIgnoreRules
- − debian/maven.ignoreRules
- − debian/maven.properties
- − debian/maven.publishedRules
- debian/maven.rules
- + debian/patches/build_gradle.patch
- + debian/patches/deactivate_test_reading_build_properties.patch
- + debian/patches/guava_interface.patch
- + debian/patches/series
- debian/rules
Changes:
=====================================
debian/README.source deleted
=====================================
@@ -1,9 +0,0 @@
-Information about milib
------------------------
-
-This package was debianized using the mh_make command
-from the maven-debian-helper package.
-
-The build system uses Maven but prevents it from downloading
-anything from the Internet, making the build compliant with
-the Debian policy.
=====================================
debian/changelog
=====================================
@@ -8,10 +8,23 @@ milib (2.0.0-1) UNRELEASED; urgency=medium
[ Andreas Tille ]
* Standards-Version: 4.6.1 (routine-update)
-
- TODO: transition to gradle
-
- -- Andreas Tille <tille at debian.org> Thu, 30 Jun 2022 16:54:50 +0200
+ * See how far we move with simply adding --buildsystem=gradle
+ * No need to patch pom.xml
+
+ [ Pierre Gruet ]
+ * Removing files from debian/ we needed for Maven previously
+ * Refreshing dependencies
+ * Refreshing Maven rules
+ * Patching build.gradle.kts to form a gradle build file
+ * Changing a call to a guava method
+ * Deactivating a test relying on a build properties file we don't provide
+
+ TODO:
+ - repack without the jar, maybe also remove gradlew
+ - add a home-made pom.xml to provide a maven-repo structure
+ - installing the built jar
+
+ -- Pierre Gruet <pgt at debian.org> Fri, 01 Jul 2022 23:18:33 +0200
milib (1.13-1) unstable; urgency=medium
=====================================
debian/control
=====================================
@@ -6,17 +6,19 @@ Priority: optional
Build-Depends: debhelper-compat (= 13),
default-jdk,
gradle-debian-helper
-Build-Depends-Indep: libcommons-compress-java (>= 1.13),
+Build-Depends-Indep: junit4 <!nocheck>,
+ libcommons-compress-java (>= 1.13),
libcommons-io-java (>= 2.5),
libcommons-math3-java,
+ libguava-java,
+ libjackson2-core-java,
libjackson2-databind-java,
- libmaven-antrun-plugin-java (>= 1.8),
- libredberry-pipe-java,
libjcommander-java,
- libtrove3-java,
- libjaxb-java,
+ liblz4-java,
+ libmockito-java <!nocheck>,
libpicocli-java,
- libbuild-helper-maven-plugin-java
+ libredberry-pipe-java,
+ libtrove3-java
Standards-Version: 4.6.1
Vcs-Browser: https://salsa.debian.org/med-team/milib
Vcs-Git: https://salsa.debian.org/med-team/milib.git
=====================================
debian/maven.cleanIgnoreRules deleted
=====================================
@@ -1 +0,0 @@
-
=====================================
debian/maven.ignoreRules deleted
=====================================
@@ -1,6 +0,0 @@
-
-junit junit * * * *
-org.apache.maven.plugins maven-surefire-plugin * * * *
-org.codehaus.mojo buildnumber-maven-plugin * * * *
-org.mockito mockito-all * * * *
-org.sonatype.plugins nexus-staging-maven-plugin * * * *
=====================================
debian/maven.properties deleted
=====================================
@@ -1,6 +0,0 @@
-# Include here properties to pass to Maven during the build.
-# For example:
-# maven.test.skip=true
-# project.build.sourceEncoding=UTF-8
-
-maven.test.skip=true
=====================================
debian/maven.publishedRules deleted
=====================================
@@ -1,2 +0,0 @@
-
-com.milaboratory milib jar s/.*/debian/ * *
=====================================
debian/maven.rules
=====================================
@@ -1,11 +1,4 @@
-cc.redberry pipe jar * * *
-com.fasterxml.jackson.core jackson-databind bundle s/.*/2.x/ * *
-com.fasterxml.jackson.core jackson-databind bundle s/2\..*/2.x/ * *
-com.fasterxml.jackson.core jackson-databind s/jar/bundle/ s/.*/2.x/ * *
-com.fasterxml.jackson.core jackson-databind s/jar/bundle/ s/2\..*/2.x/ * *
-com.milaboratory milib jar * * *
-com.milaboratory milib jar s/.*/debian/ * *
-junit junit * * * *
-org.apache.commons commons-math * * * *
-org.sonatype.plugins nexus-staging-maven-plugin * * * *
+cc.redberry pipe jar s/.*/1.0.0-alpha0/ * *
+com.fasterxml.jackson.core jackson-databind * s/.*/2.x/ * *
+junit junit * s/4.*/4.x/ * *
=====================================
debian/patches/build_gradle.patch
=====================================
@@ -0,0 +1,232 @@
+Description: changing the kotlin file into a proper file for gradle
+Author: Pierre Gruet <pgt at debian.org>
+Forwarded: not-needed
+Last-Update: 2022-07-01
+
+--- a/build.gradle.kts
++++ b/build.gradle.kts
+@@ -1,65 +1,27 @@
+-import com.palantir.gradle.gitversion.VersionDetails
+-import groovy.lang.Closure
+ import java.net.InetAddress
+ import java.util.*
+
+-plugins {
+- `java-library`
+- `java-test-fixtures`
+- `maven-publish`
+- signing
+- id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
+- id("com.palantir.git-version") version "0.13.0" // don't upgrade, latest version that runs on Java 8
+-}
+-
+-val productionBuild: Boolean? by project
+-
+-val versionDetails: Closure<VersionDetails> by extra
+-val gitDetails = versionDetails()
+-
+-fun boolProperty(name: String): Boolean {
+- return ((properties[name] as String?) ?: "false").toBoolean()
+-}
+-
+-val isMiCi = boolProperty("mi-ci")
+-val isRelease = boolProperty("mi-release")
+-
+-val longTests: String? by project
+-val miCiStage = properties["mi-ci-stage"] as String?
++apply plugin: 'java'
+
+ group = "com.milaboratory"
+-version = if (version != "unspecified") version else ""
+ description = "MiLib"
+
+-java {
+- sourceCompatibility = JavaVersion.VERSION_1_8
+- withSourcesJar()
+- withJavadocJar()
+-}
+-
+-tasks.withType<JavaCompile> {
+- options.encoding = "UTF-8"
+-}
++sourceCompatibility = JavaVersion.VERSION_1_8
+
+ repositories {
+ mavenCentral()
+-
+- // Snapshot versions of redberry-pipe distributed via this repo
+- maven {
+- url = uri("https://pub.maven.milaboratory.com")
+- }
+ }
+
+-val jacksonBomVersion = "2.13.3"
+-val junitVersion = "4.13.2"
+-val redberryPipeVersion = "1.2.0"
++def jacksonBomVersion = "2.13.3"
++def junitVersion = "4.13.2"
++def redberryPipeVersion = "1.2.0"
+
+ dependencies {
+- api("org.apache.commons:commons-math3:3.6.1")
+- api("cc.redberry:pipe:$redberryPipeVersion")
++ compile("org.apache.commons:commons-math3:3.6.1")
++ compile("cc.redberry:pipe:$redberryPipeVersion")
+
+- implementation(platform("com.fasterxml.jackson:jackson-bom:$jacksonBomVersion"))
+- implementation("com.fasterxml.jackson.core:jackson-databind")
++ implementation("com.fasterxml.jackson:jackson-bom:$jacksonBomVersion")
++ implementation("com.fasterxml.jackson.core:jackson-databind:2.x")
+ implementation("org.apache.commons:commons-compress:1.21")
+ implementation("commons-io:commons-io:2.11.0")
+ implementation("org.lz4:lz4-java:1.8.0")
+@@ -68,138 +30,28 @@
+ implementation("net.sf.trove4j:trove4j:3.0.3")
+ implementation("com.google.guava:guava:31.1-jre")
+
+- testFixturesImplementation("junit:junit:$junitVersion")
+- testFixturesImplementation(platform("com.fasterxml.jackson:jackson-bom:$jacksonBomVersion"))
+- testFixturesImplementation("com.fasterxml.jackson.core:jackson-databind")
++ testImplementation("junit:junit:$junitVersion")
++ testImplementation("com.fasterxml.jackson:jackson-bom:$jacksonBomVersion")
++ testImplementation("com.fasterxml.jackson.core:jackson-databind:2.x")
+
+ testImplementation("junit:junit:$junitVersion")
+ testImplementation("org.mockito:mockito-all:1.10.19")
+ }
+
+-val writeBuildProperties by tasks.registering(WriteProperties::class) {
+- outputFile = file("${sourceSets.main.get().output.resourcesDir}/${project.name}-build.properties")
+- property("version", version)
+- property("name", "MiLib")
+- property("revision", gitDetails.gitHash)
+- property("branch", gitDetails.branchName ?: "")
+- property("host", InetAddress.getLocalHost().hostName)
+- property("production", productionBuild == true)
+- property("timestamp", System.currentTimeMillis())
+-}
+-
+-tasks.processResources {
+- dependsOn(writeBuildProperties)
+-}
+-
+-val miRepoAccessKeyId: String? by project
+-val miRepoSecretAccessKey: String? by project
+-
+-publishing {
+- repositories {
+- if (miRepoAccessKeyId != null) {
+- maven {
+- name = "mipub"
+- url = uri("s3://milaboratory-artefacts-public-files.s3.eu-central-1.amazonaws.com/maven")
+-
+- authentication {
+- credentials(AwsCredentials::class) {
+- accessKey = miRepoAccessKeyId!!
+- secretKey = miRepoSecretAccessKey!!
+- }
+- }
+- }
++sourceSets {
++ test {
++ java {
++ srcDir 'src/test/java'
++ srcDir 'src/testFixtures/java'
+ }
+- }
+-
+- publications.create<MavenPublication>("mavenJava") {
+- from(components["java"])
+- pom {
+- withXml {
+- asNode().apply {
+- appendNode("name", "MiLib")
+- appendNode(
+- "description",
+- "Yet another Java library for Next Generation Sequencing (NGS) data processing."
+- )
+- appendNode("url", "https://milaboratories.com/")
+- }
+- }
+- licenses {
+- license {
+- name.set("The Apache License, Version 2.0")
+- url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
+- }
+- }
+- developers {
+- developer {
+- id.set("dbolotin")
+- name.set("Dmitry Bolotin")
+- email.set("bolotin.dmitriy at gmail.com")
+- }
+- developer {
+- id.set("PoslavskySV")
+- name.set("Stanislav Poslavsky")
+- email.set("stvlpos at mail.ru")
+- }
+- developer {
+- id.set("mikesh")
+- name.set("Mikhail Shugay")
+- email.set("mikhail.shugay at gmail.com")
+- }
+- }
+- scm {
+- url.set("scm:git:https://github.com/milaboratory/milib")
+- }
++ resources {
++ srcDir 'src/testFixtures/resources'
+ }
+ }
+ }
+
+-val signingKey: String? by project
+-if (signingKey != null) {
+- signing {
+- useInMemoryPgpKeys(
+- Base64.getMimeDecoder().decode(signingKey).decodeToString(),
+- ""
+- )
+- sign(publishing.publications["mavenJava"])
+- }
+-}
+-
+-tasks.withType<Javadoc> {
+- options {
+- this as StandardJavadocDocletOptions
+- addStringOption("Xdoclint:none", "-quiet")
+- }
+-}
+-
+-tasks.test {
++test {
+ useJUnit()
+ minHeapSize = "1024m"
+ maxHeapSize = "2048m"
+-
+- miCiStage?.let {
+- if (it == "test") {
+- systemProperty("longTests", "true");
+- }
+- }
+- longTests?.let { systemProperty("longTests", it) }
+-}
+-
+-nexusPublishing {
+- repositories {
+- sonatype()
+- }
+-}
+-
+-val checkPipeNotSnapshot by tasks.registering {
+- doLast {
+- if (redberryPipeVersion.contains('-'))
+- throw GradleException("Can't publish to maven central with snapshot dependencies.")
+- }
+-}
+-
+-afterEvaluate {
+- tasks.named("publishToSonatype") {
+- dependsOn(checkPipeNotSnapshot)
+- }
+ }
=====================================
debian/patches/deactivate_test_reading_build_properties.patch
=====================================
@@ -0,0 +1,24 @@
+Description: ignoring a test relying on the build properties file, which we
+ deactivated when patching the build.gradle.kts file
+Author: Pierre Gruet <pgt at debian.org>
+Forwarded: not-needed
+Last-Update: 2022-07-01
+
+--- a/src/test/java/com/milaboratory/util/VersionInfoTest.java
++++ b/src/test/java/com/milaboratory/util/VersionInfoTest.java
+@@ -16,6 +16,7 @@
+ package com.milaboratory.util;
+
+ import org.junit.Assert;
++import org.junit.Ignore;
+ import org.junit.Test;
+
+ public class VersionInfoTest {
+@@ -34,6 +35,7 @@
+ Assert.assertNull(versionInfo);
+ }
+
++ @Ignore("no build_properties file written")
+ @Test
+ public void test3() throws Exception {
+ VersionInfo versionInfo = VersionInfo.getVersionInfoForArtifact("milib");
=====================================
debian/patches/guava_interface.patch
=====================================
@@ -0,0 +1,61 @@
+Description: changing a function name in a guava class
+ In Debian we have version 29.9 of guava-libraries, and milib expects 31.1.
+Author: Pierre Gruet <pgt at debian.org>
+Forwarded: not-needed
+Last-Update: 2022-07-01
+
+--- a/src/main/java/com/milaboratory/core/mutations/Mutations.java
++++ b/src/main/java/com/milaboratory/core/mutations/Mutations.java
+@@ -775,7 +775,7 @@
+ @SuppressWarnings("UnstableApiUsage")
+ @Override
+ public int hashCode() {
+- Hasher hasher = Hashing.murmur3_32_fixed()
++ Hasher hasher = Hashing.murmur3_32()
+ .newHasher(4 + mutations.length)
+ .putInt(getAlphabet().hashCode());
+ for (int mutation : mutations)
+--- a/src/main/java/com/milaboratory/core/sequence/AbstractArraySequence.java
++++ b/src/main/java/com/milaboratory/core/sequence/AbstractArraySequence.java
+@@ -76,7 +76,7 @@
+ @SuppressWarnings("UnstableApiUsage")
+ @Override
+ public final int hashCode() {
+- return Hashing.murmur3_32_fixed().newHasher(4 + size())
++ return Hashing.murmur3_32().newHasher(4 + size())
+ .putInt(getAlphabet().hashCode())
+ .putBytes(data)
+ .hash()
+--- a/src/main/java/com/milaboratory/core/sequence/Sequence.java
++++ b/src/main/java/com/milaboratory/core/sequence/Sequence.java
+@@ -122,7 +122,7 @@
+ @SuppressWarnings("UnstableApiUsage")
+ @Override
+ public int hashCode() {
+- Hasher hasher = Hashing.murmur3_32_fixed().newHasher(4 + size());
++ Hasher hasher = Hashing.murmur3_32().newHasher(4 + size());
+ hasher.putInt(getAlphabet().hashCode());
+ for (int i = size() - 1; i >= 0; --i)
+ hasher.putByte(codeAt(i));
+--- a/src/main/java/com/milaboratory/util/ByteString.java
++++ b/src/main/java/com/milaboratory/util/ByteString.java
+@@ -49,7 +49,7 @@
+ @Override
+ public int hashCode() {
+ // Quick comparison shows that murmur hash performs computationally the same as Java-style hash
+- return Hashing.murmur3_32_fixed().hashBytes(data).hashCode();
++ return Hashing.murmur3_32().hashBytes(data).hashCode();
+ }
+
+ public String asString() {
+--- a/src/main/java/com/milaboratory/util/sorting/HashUtils.java
++++ b/src/main/java/com/milaboratory/util/sorting/HashUtils.java
+@@ -28,7 +28,7 @@
+ @SuppressWarnings("UnstableApiUsage")
+ public static <T> ToIntFunction<T> hashFunctionFor(List<? extends Property<? super T, ?>> properties) {
+ return obj -> {
+- Hasher hasher = Hashing.murmur3_32_fixed().newHasher();
++ Hasher hasher = Hashing.murmur3_32().newHasher();
+ for (Property<? super T, ?> prop : properties) {
+ hasher.putInt(prop.get(obj).hashCode());
+ }
=====================================
debian/patches/series
=====================================
@@ -0,0 +1,3 @@
+build_gradle.patch
+guava_interface.patch
+deactivate_test_reading_build_properties.patch
=====================================
debian/rules
=====================================
@@ -2,3 +2,11 @@
%:
dh $@ --buildsystem=gradle
+
+override_dh_auto_clean:
+ dh_auto_clean
+ -rm build.gradle
+
+override_dh_auto_configure:
+ cp build.gradle.kts build.gradle
+ dh_auto_configure
View it on GitLab: https://salsa.debian.org/med-team/milib/-/compare/17c3f42e92c03cecf0025f26af5548ba9d147e2b...8f0c1ba50a3dc057704eed6985606c810234dc61
--
View it on GitLab: https://salsa.debian.org/med-team/milib/-/compare/17c3f42e92c03cecf0025f26af5548ba9d147e2b...8f0c1ba50a3dc057704eed6985606c810234dc61
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220701/a08aeb36/attachment-0001.htm>
More information about the debian-med-commit
mailing list