Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
alessioborraccino authored Aug 9, 2021
2 parents ea39b90 + ecb7fdf commit cc91adb
Show file tree
Hide file tree
Showing 45 changed files with 282 additions and 209 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/d4l-ci-latest-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ on:
jobs:
latest-version:

runs-on: [self-hosted, macos]
runs-on: macos-latest

env:
PACKAGE_REGISTRY_USERNAME: ${{ secrets.PACKAGE_REGISTRY_USERNAME }}
PACKAGE_REGISTRY_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
PACKAGE_REGISTRY_DOWNLOAD_USERNAME: ${{ secrets.PACKAGE_REGISTRY_DOWNLOAD_USERNAME }}
PACKAGE_REGISTRY_DOWNLOAD_TOKEN: ${{ secrets.PACKAGE_REGISTRY_DOWNLOAD_TOKEN }}
PACKAGE_REGISTRY_UPLOAD_USERNAME: ${{ secrets.PACKAGE_REGISTRY_UPLOAD_USERNAME }}
PACKAGE_REGISTRY_UPLOAD_TOKEN: ${{ secrets.PACKAGE_REGISTRY_UPLOAD_TOKEN }}

steps:
- name: Display runner context
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/d4l-ci-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on:
jobs:
publish-release:

runs-on: [self-hosted, macos]
runs-on: macos-latest

env:
PACKAGE_REGISTRY_USERNAME: ${{ secrets.PACKAGE_REGISTRY_USERNAME }}
PACKAGE_REGISTRY_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
PACKAGE_REGISTRY_DOWNLOAD_USERNAME: ${{ secrets.PACKAGE_REGISTRY_DOWNLOAD_USERNAME }}
PACKAGE_REGISTRY_DOWNLOAD_TOKEN: ${{ secrets.PACKAGE_REGISTRY_DOWNLOAD_TOKEN }}
PACKAGE_REGISTRY_UPLOAD_USERNAME: ${{ secrets.PACKAGE_REGISTRY_UPLOAD_USERNAME }}
PACKAGE_REGISTRY_UPLOAD_TOKEN: ${{ secrets.PACKAGE_REGISTRY_UPLOAD_TOKEN }}

steps:
- name: Display runner context
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/d4l-ci-pull-request-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ on:
jobs:
pull-request-validation:

runs-on: [self-hosted, macos]
runs-on: macos-latest

concurrency:
group: validation-${{ github.head_ref }}
cancel-in-progress: true

env:
PACKAGE_REGISTRY_USERNAME: ${{ secrets.PACKAGE_REGISTRY_USERNAME }}
PACKAGE_REGISTRY_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
PACKAGE_REGISTRY_DOWNLOAD_USERNAME: ${{ secrets.PACKAGE_REGISTRY_DOWNLOAD_USERNAME }}
PACKAGE_REGISTRY_DOWNLOAD_TOKEN: ${{ secrets.PACKAGE_REGISTRY_DOWNLOAD_TOKEN }}
PACKAGE_REGISTRY_UPLOAD_USERNAME: ${{ secrets.PACKAGE_REGISTRY_UPLOAD_USERNAME }}
PACKAGE_REGISTRY_UPLOAD_TOKEN: ${{ secrets.PACKAGE_REGISTRY_UPLOAD_TOKEN }}

steps:
- name: Display runner context
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Gradle
.gradle/
.gradle/*
build/
out/
local.properties
Expand All @@ -16,7 +17,6 @@ local.properties
!.idea/codeStyles/
!.idea/encoding.xml
!.idea/copyright/
!.idea/compiler.xml

# generated

Expand Down
Binary file removed .gradle/6.5/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/6.5/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/6.5/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/6.5/gc.properties
Empty file.
Binary file removed .gradle/6.8.3/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/6.8.3/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/6.8.3/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/6.8.3/gc.properties
Empty file.
Binary file removed .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 0 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties

This file was deleted.

Binary file removed .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file removed .gradle/checksums/checksums.lock
Binary file not shown.
Binary file removed .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file removed .gradle/checksums/sha1-checksums.bin
Binary file not shown.
Empty file.
Empty file removed .gradle/vcs-1/gc.properties
Empty file.
Binary file removed .gradle/workspace-id.txt
Binary file not shown.
Binary file removed .gradle/workspace-id.txt.lock
Binary file not shown.
15 changes: 0 additions & 15 deletions .idea/compiler.xml

This file was deleted.

4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= Data4Life Result Util SDK
:result-util-sdk-version: 0.1.0
= Data4Life Result SDK
:result-sdk-version: 0.1.0
:doctype: article
:!showtitle:
:toc: macro
Expand Down
23 changes: 9 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,17 @@
* applications and/or if you’d like to contribute to the development of the SDK, please
* contact D4L by email to [email protected].
*/

buildscript {
dependencies {
classpath(GradlePlugins.kotlin)
classpath(GradlePlugins.android)
}
}
import care.data4life.sdk.result.dependency.d4l
import care.data4life.sdk.result.dependency.gitHub

plugins {
kotlinMultiplatform(false)
id("care.data4life.sdk.result.dependency")

id("scripts.dependency-updates")
id("scripts.download-scripts")
id("scripts.publishing")
id("scripts.quality-spotless")
id("scripts.versioning")
id("care.data4life.sdk.result.dependency-updates")
id("care.data4life.sdk.result.download-scripts")
id("care.data4life.sdk.result.publishing")
id("care.data4life.sdk.result.quality-spotless")
id("care.data4life.sdk.result.versioning")
}

allprojects {
Expand All @@ -43,6 +38,6 @@ allprojects {
}

tasks.named<Wrapper>("wrapper") {
gradleVersion = "6.8.3"
gradleVersion = "6.9"
distributionType = Wrapper.DistributionType.ALL
}
6 changes: 6 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@

plugins {
`kotlin-dsl`

id("care.data4life.sdk.result.dependency")
}

repositories {
gradlePluginPortal()
mavenCentral()
google()
}

dependencies {
implementation(care.data4life.sdk.result.dependency.GradlePlugin.kotlin)
implementation(care.data4life.sdk.result.dependency.GradlePlugin.android)

// dependency-updates
implementation("com.github.ben-manes:gradle-versions-plugin:0.38.0")
// download-scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@
* applications and/or if you’d like to contribute to the development of the SDK, please
* contact D4L by email to [email protected].
*/
package care.data4life.sdk.result

object LibraryConfig {
val publishConfig = PublishConfig
val android = AndroidLibraryConfig

const val group = "care.data4life"
const val name = "hc-result-sdk-kmp"

const val githubOwner = "d4l-data4life"
const val githubRepository = "hc-result-sdk-kmp"

val publish = PublishConfig

object PublishConfig {
const val name = LibraryConfig.name
const val groupId = "care.data4life.hc-result-sdk-kmp"
const val description = "This is the Result SDK which provides unified result types and errors for other SDK's."
const val groupId = "${LibraryConfig.group}.${LibraryConfig.name}"

const val year = "2020"
const val year = "2021"

// URL
const val host = "github.com"
Expand All @@ -52,8 +53,6 @@ object LibraryConfig {
const val scmDeveloperConnection = scmConnection
}

val android = AndroidLibraryConfig

object AndroidLibraryConfig {
const val minSdkVersion = 23
const val compileSdkVersion = 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* contact D4L by email to [email protected].
*/

package scripts
package care.data4life.sdk.result

/**
* [DependencyUpdates](https://github.com/ben-manes/gradle-versions-plugin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* contact D4L by email to [email protected].
*/

package scripts
package care.data4life.sdk.result

import de.undercouch.gradle.tasks.download.Download

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
* contact D4L by email to [email protected].
*/

package scripts
package care.data4life.sdk.result

import LibraryConfig
import org.gradle.api.publish.maven.MavenPublication

/**
* Usage:
* Install:
*
* Now just add id("scripts.publishing-config") to your projects build.gradle.kts plugins section
* Just add id("care.data4life.sdk.result.publishing-config") to your project module build.gradle.kts plugins section
*
* plugins {
* id("scripts.publishing")
* id("care.data4life.sdk.result.publishing-config")
* }
*
* Usage:
*
* To publish to to https://github.com/d4l-data4life/maven-repository/ just run:
* - ./gradlew publishFeature
* - ./gradlew publishSnapshot
* - ./gradlew publishRelease
*
* This requires a LibraryConfig as defined here https://github.com/d4l-data4life/hc-gradle-scripts/blob/main/buildSrc/src/main/kotlin/LibraryConfig.kt
* This requires a care.data4life.sdk.result.care.data4life.sdk.result.LibraryConfig configured
*/
plugins {
`maven-publish`
Expand All @@ -46,9 +47,9 @@ publishing {
setUrl("https://maven.pkg.github.com/${LibraryConfig.githubOwner}/${LibraryConfig.githubRepository}")
credentials {
username = (project.findProperty("gpr.user")
?: System.getenv("PACKAGE_REGISTRY_USERNAME")).toString()
?: System.getenv("PACKAGE_REGISTRY_UPLOAD_USERNAME")).toString()
password = (project.findProperty("gpr.key")
?: System.getenv("PACKAGE_REGISTRY_TOKEN")).toString()
?: System.getenv("PACKAGE_REGISTRY_UPLOAD_TOKEN")).toString()
}
}

Expand All @@ -72,34 +73,33 @@ publishing {

publications {
withType<MavenPublication> {
groupId = LibraryConfig.publish.groupId
groupId = LibraryConfig.PublishConfig.groupId

pom {
name.set(LibraryConfig.publish.name)
description.set(LibraryConfig.publish.description)
url.set(LibraryConfig.publish.url)
inceptionYear.set(LibraryConfig.publish.year)
description.set(LibraryConfig.PublishConfig.description)
url.set(LibraryConfig.PublishConfig.url)
inceptionYear.set(LibraryConfig.PublishConfig.year)

licenses {
license {
name.set(LibraryConfig.publish.licenseName)
url.set(LibraryConfig.publish.licenseUrl)
distribution.set(LibraryConfig.publish.licenseDistribution)
name.set(LibraryConfig.PublishConfig.licenseName)
url.set(LibraryConfig.PublishConfig.licenseUrl)
distribution.set(LibraryConfig.PublishConfig.licenseDistribution)
}
}

developers {
developer {
id.set(LibraryConfig.publish.developerId)
name.set(LibraryConfig.publish.developerName)
email.set(LibraryConfig.publish.developerEmail)
id.set(LibraryConfig.PublishConfig.developerId)
name.set(LibraryConfig.PublishConfig.developerName)
email.set(LibraryConfig.PublishConfig.developerEmail)
}
}

scm {
connection.set(LibraryConfig.publish.scmConnection)
developerConnection.set(LibraryConfig.publish.scmDeveloperConnection)
url.set(LibraryConfig.publish.scmUrl)
connection.set(LibraryConfig.PublishConfig.scmConnection)
developerConnection.set(LibraryConfig.PublishConfig.scmDeveloperConnection)
url.set(LibraryConfig.PublishConfig.scmUrl)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
* contact D4L by email to [email protected].
*/

package scripts
package care.data4life.sdk.result

import LibraryConfig
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.api.ResetCommand
import org.eclipse.jgit.transport.PushResult
import org.eclipse.jgit.transport.RemoteRefUpdate
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider

/**
* Usage:
* Publish generated artefacts to our maven-repository using [jGit](https://www.eclipse.org/jgit/)
*
* Install:
*
* You need to add following dependencies to the buildSrc/build.gradle.kts
*
Expand All @@ -38,12 +39,14 @@ import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider
* mavenCentral()
* }
*
* Now just add id("scripts.publishing") to your rootProject build.gradle.kts plugins
* Now just add id("care.data4life.sdk.result.publishing") to your rootProject build.gradle.kts plugins
*
* plugins {
* id("scripts.publishing")
* id("care.data4life.sdk.result.publishing")
* }
*
* Usage:
*
* To publish to to https://github.com/d4l-data4life/maven-features/ just run:
* - ./gradlew publishFeature
* To publish to to https://github.com/d4l-data4life/maven-snapshots/ just run:
Expand All @@ -63,7 +66,7 @@ val releaseRepoName = "maven-releases"
val basePath = "${rootProject.buildDir}/gitPublish"

val gitHubToken = (project.findProperty("gpr.key")
?: System.getenv("PACKAGE_REGISTRY_TOKEN")).toString()
?: System.getenv("PACKAGE_REGISTRY_UPLOAD_TOKEN")).toString()


task<Exec>("publishFeature") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* contact D4L by email to [email protected].
*/

package scripts
package care.data4life.sdk.result

/**
* You need to add following dependencies to the buildSrc/build.gradle.kts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* applications and/or if you’d like to contribute to the development of the SDK, please
* contact D4L by email to [email protected].
*/
package scripts
package care.data4life.sdk.result

/**
* Usage:
Expand Down
Loading

0 comments on commit cc91adb

Please sign in to comment.