Skip to content

Commit

Permalink
Update plugins build script
Browse files Browse the repository at this point in the history
  • Loading branch information
pditommaso committed Aug 6, 2021
1 parent da8b77b commit 8057677
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

plugins {
id "java"
id "io.nextflow.nf-build-plugin" version "1.0.0"
id "io.nextflow.nf-build-plugin" version "1.0.1"
}

ext.github_organization = 'nextflow-io'
Expand All @@ -42,16 +42,16 @@ List<String> allPlugins() {
return plugins
}

String verFromManifest(File file) {
String metaFromManifest(String meta, File file) {
def str = file.text
def regex = ~/(?m)^Plugin-Version:\s*([\w-\.]+)$/
def regex = ~/(?m)^$meta:\s*([\w-\.<>=]+)$/
def m = regex.matcher(str)
if( m.find() ) {
def ver = m.group(1)
//println "Set plugin '${file.parentFile.parentFile.parentFile.parentFile.name}' version=${ver}"
return ver
}
throw new GradleException("Cannot find version for plugin: $file")
throw new GradleException("Cannot find '$meta' for plugin: $file")
}

def timestamp = now()
Expand All @@ -66,7 +66,7 @@ subprojects {
mavenCentral()
}

version = verFromManifest(file('src/resources/META-INF/MANIFEST.MF'))
version = metaFromManifest('Plugin-Version',file('src/resources/META-INF/MANIFEST.MF'))

/*
* Creates plugin zip and json meta file in plugin `build/libs` directory
Expand All @@ -88,6 +88,7 @@ subprojects {
"version": "${project.version}",
"date": "${timestamp}",
"url": "https://github.com/${github_organization}/${project.name}/releases/download/${project.version}/${project.name}-${project.version}.zip",
"requires": "${metaFromManifest('Plugin-Requires',file('src/resources/META-INF/MANIFEST.MF'))}",
"sha512sum": "${computeSha512(zip)}"
}
""".stripIndent()
Expand Down

0 comments on commit 8057677

Please sign in to comment.