Skip to content

Commit

Permalink
Merge branch 'main' into renovate/groovy-monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie authored Dec 23, 2024
2 parents 0fa861c + 5a98e1d commit b73a681
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if (groovyVer) {

// (Optional) If transitive Groovy dependencies cause conflicts
force "org.${groovySource}.groovy:groovy-all:$groovyVer"
if ((details.requested.group == 'org.codehaus.groovy') && details.requested.version != groovyVer) {
if ((details.requested.group == "org.${groovySource}.groovy") && details.requested.version != groovyVer) {
if (groovyVer.contains(':')) {
details.useTarget(groovyVer)
}
Expand Down Expand Up @@ -82,17 +82,17 @@ allprojects {
idea {
module.inheritOutputDirs = true
}

repositories {
mavenCentral()
maven { url 'https://repo.eclipse.org/content/groups/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://repo.eclipse.org/content/groups/releases' }
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
}

configurations {
// see https://docs.gradle.org/4.1/userguide/dependency_management.html#sub:exclude_transitive_dependencies
all*.exclude group: 'org.codehaus.groovy', module: 'groovy-all'
all*.exclude group: 'org.codehaus.groovy', module: 'groovy-cli-picocli'
all*.exclude group: 'org.apache.groovy', module: 'groovy-all'
all*.exclude group: 'org.apache.groovy', module: 'groovy-cli-picocli'
// groovydoc libs
groovyDoc.extendsFrom runtime
}
Expand Down
2 changes: 1 addition & 1 deletion gradle-groovysh-init.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gradle.projectsLoaded {

project.dependencies {
groovyshdependencies("org.${groovySource}.groovy:groovy-groovysh:${GroovySystem.version}") {
exclude group: 'org.codehaus.groovy'
exclude group: "org.${groovySource}.groovy"
}
}

Expand Down
6 changes: 3 additions & 3 deletions groovysh-task.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gradle.projectsLoaded {
// To be able to load org.codehaus.groovy:groovy-groovysh and dependencies
mavenCentral {
content {
includeGroup 'org.codehaus.groovy'
includeGroup "org.${groovySource}.groovy"
includeGroup 'jline'
includeGroup 'com.github.javaparser'
includeGroup 'org.ow2.asm'
Expand All @@ -22,7 +22,7 @@ gradle.projectsLoaded {

project.dependencies {
groovyshdependencies "org.${groovySource}.groovy:groovy-groovysh:$groovyVer" {
exclude group: 'org.codehaus.groovy'
exclude group: "org.${groovySource}.groovy"
}
}

Expand All @@ -37,7 +37,7 @@ gradle.projectsLoaded {

def groovyshClass
def groovyShell
groovyshClass = Class.forName('org.codehaus.groovy.groovysh.Groovysh', true, groovyshClassLoader)
groovyshClass = Class.forName("org.${groovySource}.groovy.groovysh.Groovysh", true, groovyshClassLoader)
if (groovyshClass) {
groovyShell = groovyshClass.newInstance()
if (groovyShell) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ subprojects {
tasks.register('copyPluginLibs', Sync) {
from configurations.runtimeClasspath
into 'build/target/libs'
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
}

/*
Expand Down
16 changes: 4 additions & 12 deletions plugins/nf-quilt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,33 +72,25 @@ dependencies {

// This dependency is exported to consumers, that is to say found on their compile classpath.
compileOnly "io.nextflow:nextflow:$nextflowVersion"
// compileOnly "io.nextflow:nf-commons:$nextflowVersion"
compileOnly 'org.slf4j:slf4j-api:2.1.0-alpha1'
compileOnly 'org.pf4j:pf4j:3.13.0'
// add here plugins depepencies
// compileOnly 'org.slf4j:slf4j-simple:2.1.0-alpha1'
// compileOnly 'black.ninia:jep:4.2.2'
// runtime 'black.ninia:jep:4.2.2'
compileOnly 'org.pf4j:pf4j:3.12.0'
runtimeOnly 'org.junit.platform:junit-platform-launcher:1.11.3'
implementation 'commons-io:commons-io:2.17.0'
// implementation 'black.ninia:jep:4.2.2'
// testImplementation 'black.ninia:jep:4.2.2'
//testImplementation(testFixtures('black.ninia:jep:4.0.3'))

// test configuration
testImplementation "io.nextflow:nextflow:$nextflowVersion"
// testImplementation "io.nextflow:nf-commons:$nextflowVersion"
testImplementation "org.${groovySource}.groovy:groovy:$groovyVersion"
testImplementation "org.${groovySource}.groovy:groovy-nio:$groovyVersion"
testImplementation ("org.${groovySource}.groovy:groovy-test:$groovyVersion") { exclude group: 'org.codehaus.groovy' }
testImplementation ("org.${groovySource}.groovy:groovy-test:$groovyVersion") { exclude group: "org.${groovySource}.groovy" }
testImplementation('cglib:cglib-nodep:3.3.0')
testImplementation('org.objenesis:objenesis:3.4')
testImplementation("org.spockframework:spock-core:2.3-$groovyV") {
exclude group: 'org.codehaus.groovy'
exclude group: "org.${groovySource}.groovy"
exclude group: 'net.bytebuddy'
}
testImplementation("org.spockframework:spock-junit4:2.3-$groovyV") {
exclude group: 'org.codehaus.groovy'
exclude group: "org.${groovySource}.groovy"
exclude group: 'net.bytebuddy'
}
testImplementation('com.google.jimfs:jimfs:1.3.0')
Expand Down
3 changes: 1 addition & 2 deletions plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import java.time.LocalDateTime
import groovy.transform.CompileStatic
import groovy.text.GStringTemplateEngine
import groovy.util.logging.Slf4j
import groovy.json.JsonOutput

/**
* Plugin observer of workflow events
Expand Down Expand Up @@ -411,7 +410,7 @@ ${nextflow}
}

try {
String qs_json = JsonOutput.toJson(quilt_summarize)
String qs_json = QuiltPackage.arrayToJson(quilt_summarize)
writeString(qs_json, pkg, SUMMARY_FILE)
}
catch (Exception e) {
Expand Down
14 changes: 12 additions & 2 deletions plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ import com.quiltdata.quiltcore.key.LocalPhysicalKey
import com.quiltdata.quiltcore.key.S3PhysicalKey

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.ObjectWriter
import com.fasterxml.jackson.databind.node.ObjectNode

@Slf4j
@CompileStatic
class QuiltPackage {

private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
private static final ObjectWriter OBJECT_WRITER = OBJECT_MAPPER.writerWithDefaultPrettyPrinter()
private static final Map<String,QuiltPackage> PKGS = [:]
private static final String INSTALL_PREFIX = 'QuiltPackage'
static final Path INSTALL_ROOT = Files.createTempDirectory(INSTALL_PREFIX)
Expand Down Expand Up @@ -74,13 +77,20 @@ class QuiltPackage {
return str.replace('\'', '_')
}

static String arrayToJson(List<Map> array) {
List<String> entries = array.collect { dict ->
return toJson(dict)
}
return "[${entries.join(',')}]".toString()
}

static String toJson(Map dict) {
List<String> entries = dict.collect { key, value ->
String prefix = JsonOutput.toJson(key)
String prefix = OBJECT_WRITER.writeValueAsString(key)
log.debug("toJson.${key}: ${value}")
String suffix = "toJson.error[${value}]"
try {
suffix = JsonOutput.toJson(value)
suffix = OBJECT_WRITER.writeValueAsString(value)
}
catch (Exception e) {
log.error(suffix, e)
Expand Down

0 comments on commit b73a681

Please sign in to comment.