Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: ["**"]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [11, 21]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test with Gradle
run: ./gradlew test --no-daemon
25 changes: 13 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
// enable intellij integration & load vmf version to be used
buildscript {

ext.commonProps = new Properties()
file(new File(rootProject.getRootDir(),"config/common.properties")).
withInputStream { {commonProps.load(it) }}

ext.vmfPluginIntelliJIntegration = true

repositories {
mavenCentral()
jcenter()
}

dependencies {
//
}
}

plugins {
id "com.github.hierynomus.license" version "0.13.1"
id "com.github.hierynomus.license" version "0.16.1"
id 'maven-publish'
id 'net.nemerosa.versioning' version '2.4.0'
id 'com.jfrog.bintray' version '1.8.4'
id 'com.github.ben-manes.versions' version '0.13.0'
id 'net.nemerosa.versioning' version '3.1.0'
id 'com.github.ben-manes.versions' version '0.52.0'
}

apply plugin: 'java'
apply from: 'gradle/publishing.gradle'

wrapper {
gradleVersion = '5.3'
gradleVersion = '8.14.2'
}

sourceCompatibility = '1.8'
Expand All @@ -40,13 +42,12 @@ tasks.withType(Javadoc) {
}

repositories {
jcenter()
mavenCentral()
mavenLocal()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.10'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}

license {
Expand Down
1 change: 1 addition & 0 deletions config/common.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
publication.version = 0.3.4
34 changes: 16 additions & 18 deletions gradle/project-info.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
// -----------------------------------------------------------------------------
// publishing information
// -----------------------------------------------------------------------------
ext.publishing.artifactId = project.name.toLowerCase()
ext.publishing.groupId = 'eu.mihosoft.vcollections'
ext.publishing.versionId = '0.3.3'
ext.publishingInfo.artifactId = project.name.toLowerCase()
ext.publishingInfo.groupId = 'eu.mihosoft.vcollections'
ext.publishingInfo.versionId = ext.commonProps.get("publication.version")

ext.publishing.developerName = 'Michael Hoffer'
ext.publishing.developerAlias = 'miho'
ext.publishing.developerEmail = 'info@michaelhoffer.de'
ext.publishing.inceptionYear = '2017'
ext.publishingInfo.developerName = 'Michael Hoffer'
ext.publishingInfo.developerAlias = 'miho'
ext.publishingInfo.developerEmail = 'info@michaelhoffer.de'
ext.publishingInfo.inceptionYear = '2017'

ext.publishing.bintray.repo = 'VCollections'
ext.publishing.bintray.userOrg = 'miho'
ext.publishing.bintray.name = project.name
ext.publishingInfo.desc = 'Lightweight observable collections (used by VMF and VRL)'
ext.publishingInfo.license = 'Apache-2.0'
ext.publishingInfo.licenseUrl = 'https://github.com/miho/VCollections/blob/master/LICENSE.txt'
ext.publishingInfo.labels = ['collections', 'observable', 'vmf', 'modeling', 'data model', 'vrl', 'modeling framework']
ext.publishingInfo.websiteUrl = 'https://github.com/miho/VCollections'
ext.publishingInfo.issueTrackerUrl = 'https://github.com/miho/VCollections/issues'
ext.publishingInfo.vcsUrl = 'https://github.com/miho/VCollections.git'

ext.publishing.desc = 'Lightweight observable collections (used by VMF and VRL)'
ext.publishing.license = 'BSD 2-Clause'
ext.publishing.licenseUrl = 'https://github.com/miho/VCollections/blob/master/LICENSE.txt'
ext.publishing.labels = ['collections', 'observable', 'vmf', 'modeling', 'data model', 'vrl', 'modeling framework']
ext.publishing.websiteUrl = 'https://github.com/miho/VCollections'
ext.publishing.issueTrackerUrl = 'https://github.com/miho/VCollections/issues'
ext.publishing.vcsUrl = 'https://github.com/miho/VCollections.git'
ext.publishingInfo.gitHubMavenRepo = "https://maven.pkg.github.com/miho/VCollections"

ext.publishing.pomName = ext.publishing.artifactId
ext.publishingInfo.pomName = ext.publishingInfo.artifactId
157 changes: 104 additions & 53 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
// -----------------------------------------------------------------------------
// Collect publishing information
// -----------------------------------------------------------------------------
ext.publishing = [:]
ext.publishing.bintray = [:]
ext.publishingInfo = [:]

ext.publishing.pomName = ext.publishing.artifactId
ext.publishingInfo.pomName = ext.publishingInfo.artifactId

apply from: "gradle/project-info.gradle"
apply plugin: 'signing'

// -----------------------------------------------------------------------------
// Performs publishing
// -----------------------------------------------------------------------------

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

// create one jar for the source files
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

Expand All @@ -28,6 +28,7 @@ artifacts {
archives javadocJar
archives sourcesJar
}

Date buildTimeAndDate = new Date()
ext {
buildDate = new java.text.SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
Expand All @@ -37,86 +38,136 @@ ext {
jar {
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Build-Revision': versioning.info.commit,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Build-Revision': versioning.info.commit,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}


def pomConfig = {
name ext.publishing.pomName
description ext.publishing.desc
url ext.publishing.websiteUrl
inceptionYear ext.publishing.inceptionYear
name ext.publishingInfo.pomName
description ext.publishingInfo.desc
url ext.publishingInfo.websiteUrl
inceptionYear ext.publishingInfo.inceptionYear
licenses {
license([:]) {
name ext.publishing.license
url ext.publishing.licenseUrl
name ext.publishingInfo.license
url ext.publishingInfo.licenseUrl
distribution 'repo'
}
}
scm {
url ext.publishing.vcsUrl
connection ext.publishing.vcsUrl
developerConnection ext.publishing.vcsUrl
url ext.publishingInfo.vcsUrl
connection ext.publishingInfo.vcsUrl
developerConnection ext.publishingInfo.vcsUrl
}
developers {
developer {
id ext.publishing.developerNameAlias
name ext.publishing.developerName
id ext.publishingInfo.developerNameAlias
name ext.publishingInfo.developerName
}
}
}



publishing {

repositories {
// --------------------------------------------------------------------------------
// Destination Repository 'GitHubPackages'
// -> call task 'publishMavenJavaPublicationToGitHubPackagesRepository' to publish
// --------------------------------------------------------------------------------
maven {
name = "GitHubPackages"
// see https://levelup.gitconnected.com/publish-a-maven-package-to-github-with-gradle-fabc6de24d6
// Replace OWNER and REPOSITORY with your GitHub username/repository
// (must be both lowercase according to the documenations)
// url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY")
url = uri(project.findProperty('publishingInfo').gitHubMavenRepo)
credentials {
// Make sure to generate a token with write-packages and read-packages permission:
// https://github.com/settings/tokens/new
// You can either store the username and token in
// ~/.gradle/gradle.properties (use the gpr.user and gpr.key keys)
// Or you can store them as environment variables e.g. in ~/.bash_profile or ~/.zsh
// depending on your shell (GITHUB_USERNAME and GITHUB_TOKEN keys)
// Or you pass them via CLI: gradle publish -Pgpr.user=username -Pgpr.key=token
// See at EOF for examples on how to store the credentials
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}

// --------------------------------------------------------------------------------
// Destination Repository 'OSSRH'
// telling gradle to publish artifact to local directory
// -> call task 'publishMavenJavaPublicationToOSSRHRepository' to publish
// -> go to https://oss.sonatype.org/#stagingRepositories, click 'close', drink coffee and then click 'release'
// if closing was successful
// --------------------------------------------------------------------------------
maven {
name = "OSSRH"
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username = project.findProperty("oss.user") ?: System.getenv("OSS_USERNAME")
password = project.findProperty("oss.pwd") ?: System.getenv("OSS_PWD")
}
}

// --------------------------------------------------------------------------------
// Destination Repository 'BuildDir'
// telling gradle to publish artifact to local directory
// -> call task 'publishMavenJavaPublicationToBuildDirRepository' to publish
// --------------------------------------------------------------------------------
maven {
name = "BuildDir"
url "file:/${buildDir}/artifacts"
}
}


publications {
mavenCustom(MavenPublication) {
groupId publishing.groupId
artifactId publishing.artifactId
version publishing.versionId
mavenJava(MavenPublication) {
groupId publishingInfo.groupId
artifactId publishingInfo.artifactId
version publishingInfo.versionId
from components.java
artifact sourcesJar
artifact javadocJar

pom.withXml {
def root = asNode()
root.appendNode 'description', publishing.desc
root.appendNode 'description', publishingInfo.desc
root.children().last() + pomConfig
}
}
}
}

if (!project.hasProperty('bintrayUsername')) ext.bintrayUsername = ''
if (!project.hasProperty('bintrayApiKey')) ext.bintrayApiKey = ''

bintray {
user = project.bintrayUsername
key = project.bintrayApiKey
publications = ['mavenCustom']
pkg {
repo = publishing.bintray.repo
userOrg = publishing.bintray.userOrg
name = publishing.bintray.name
desc = publishing.desc
licenses = [publishing.license]
labels = publishing.labels
websiteUrl = publishing.websiteUrl
issueTrackerUrl = publishing.issueTrackerUrl
vcsUrl = publishing.vcsUrl
publicDownloadNumbers = true

version {
name = publishing.versionId
vcsTag = 'v' + publishing.versionId
}

if(
project.findProperty("signing.secretKeyRingFile")
&& project.findProperty("signing.password")
&& project.findProperty("signing.keyId")
) {

signing {
sign publishing.publications
}

} else {
println "> skipping signing, provide\n" +
" - 'signing.secretKeyRingFile'\n" +
" - 'signing.password'\n" +
" - 'signing.keyId'\n" +
" to activate it\n"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading