Skip to content

Commit

Permalink
fix update site
Browse files Browse the repository at this point in the history
  • Loading branch information
stempler committed Feb 3, 2024
1 parent cc46efd commit e241f32
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,12 @@ task('publishJarsToMavenLocal', type: GradleBuild) {
* Requires Jars to be created and artifacts published to Maven Local beforehand.
*/
task('updateSite', type: GradleBuild) {
buildFile = file('updatesite.gradle')
buildFile = file('updatesite/build.gradle')
buildName = 'updateSite'

startParameter.projectProperties.publications = jarFolder.getAbsolutePath()

tasks = ['updateSite']
tasks = ['clean', 'updateSite']
}

/**
Expand Down
22 changes: 8 additions & 14 deletions updatesite.gradle → updatesite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
* versions.
*/

import org.semver4j.Semver
import org.osgi.framework.Version

buildscript {
repositories {
mavenCentral()
}
dependencies {
// for Semver class
classpath 'org.semver4j:semver4j:5.2.2'
// for Version class
classpath 'org.osgi:osgi.core:6.0.0'
}
}

Expand Down Expand Up @@ -75,10 +75,10 @@ platform {
def releaseVersion = artifactVersions[name]

if (releaseVersion) {
def semver = Semver.parse(releaseVersion)
def versionObj = Version.parseVersion(releaseVersion)

if (!semver) {
throw new IllegalStateException("Version $releaseVersion cannot be parsed as semantic version")
if (!versionObj) {
throw new IllegalStateException("Version $releaseVersion cannot be parsed as OSGi version")
}

// define bundle - Maven dependency points to latest version
Expand All @@ -90,18 +90,12 @@ platform {
}

// collect versions to determine feature version
collectedVersions.add(semver)
collectedVersions.add(versionObj)
}

}

// set feature version
featureVersion = collectedVersions.sort()[-1].version

/*
* Note: A feature with version 1.0.0 is created anyway - it seems this might
* be a bnd-platform bug. It includes the bundles with the original versions,
* not the ones we set.
*/
featureVersion = collectedVersions.sort()[-1].toString()

}
Empty file added updatesite/settings.gradle
Empty file.

0 comments on commit e241f32

Please sign in to comment.