Skip to content

Commit

Permalink
Merge pull request #10 from RADAR-base/release-1.1.3
Browse files Browse the repository at this point in the history
Release 1.1.3
  • Loading branch information
yatharthranjan authored Jun 22, 2021
2 parents ea21ddf + acfdce0 commit 6443d36
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 136 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ jobs:
files: 'build/libs/*;radar-spring-auth/build/libs/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}

# Upload to bintray
- name: Upload to Bintray
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
run: ./gradlew bintrayUpload
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew -Psigning.gnupg.keyName=${{ secrets.OSSRH_GPG_SECRET_KEY_NAME }} -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} publish closeAndReleaseSonatypeStagingRepository

48 changes: 0 additions & 48 deletions build.gradle

This file was deleted.

66 changes: 66 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version("1.3.70") apply(false)
id("org.jetbrains.dokka") version("0.10.0")
id("io.github.gradle-nexus.publish-plugin") version("1.1.0")
}

group = "org.radarbase"
version = "1.1.3"

java.sourceCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.70")
testImplementation("junit:junit:4.12")
}


subprojects {

apply(plugin = "java")
apply(plugin = "kotlin")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "maven-publish")

repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
}

tasks.dokka {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
}
}

fun Project.propertyOrEnv(propertyName: String, envName: String): String? {
return if (hasProperty(propertyName)) {
property(propertyName)?.toString()
} else {
System.getenv(envName)
}
}

nexusPublishing {
repositories {
sonatype {
username.set(propertyOrEnv("ossrh.user", "OSSRH_USER"))
password.set(propertyOrEnv("ossrh.password", "OSSRH_PASSWORD"))
}
}
}

tasks.wrapper {
gradleVersion = "6.2.1"
}
89 changes: 17 additions & 72 deletions radar-spring-auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.throwGradleExceptionIfError
plugins {
id("kotlin-kapt")
id("maven-publish")
id("com.jfrog.bintray") version ("1.8.4")
id("com.jfrog.artifactory") version "4.10.0" apply true
id("signing")
}

group = "org.radarbase"
Expand All @@ -21,14 +20,14 @@ repositories {
}

// Dependecy versions
val mpVersion = "0.6.5"
val mpVersion = "0.7.1"
val springVersion = "5.2.4.RELEASE"
val slf4jVersion = "1.7.30"
val aspectJVersion = "1.9.5"
val javaXServletVersion = "2.5"

dependencies {
api(group = "org.radarcns", name = "radar-auth", version = mpVersion)
api(group = "org.radarbase", name = "radar-auth", version = mpVersion)
api(group = "org.slf4j", name = "slf4j-api", version = slf4jVersion)
implementation(group = "org.springframework", name = "spring-web", version = springVersion)
implementation(group = "org.springframework", name = "spring-context", version = springVersion)
Expand All @@ -37,11 +36,15 @@ dependencies {
}

tasks.compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions {
jvmTarget = "1.8"
}
}

tasks.compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions {
jvmTarget = "1.8"
}
}

tasks.dokka {
Expand All @@ -52,7 +55,7 @@ tasks.dokka {
val dokkaJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
classifier = "javadoc"
archiveClassifier.set("javadoc")
from(tasks.dokka)
}

Expand Down Expand Up @@ -100,73 +103,15 @@ publishing {
}
}
}
repositories {
maven {
url = uri("$buildDir/repository")
}
}
}

bintray {
user =
(System.getenv("BINTRAY_USER") ?: project.properties["bintrayUser"])?.toString()
key =
(System.getenv("BINTRAY_API_KEY") ?: project.properties["bintrayApiKey"])?.toString()
override = false
setPublications("mavenJar")
with(pkg) {
repo = project.group as String?
name = project.name
userOrg = "radar-base"
desc = project.description
setLicenses("Apache-2.0")
websiteUrl = website
issueTrackerUrl = "$githubUrl/issues"
vcsUrl = githubUrl
githubRepo = githubRepoName
with(version) {
name = project.version as String?
desc = project.description
vcsTag = System.getenv("TRAVIS_TAG")
}
}
}

artifactory {
setContextUrl("https://oss.jfrog.org/artifactory")
publish(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
repository(delegateClosureOf<groovy.lang.GroovyObject> {
val targetRepoKey = "oss-snapshot-local"
setProperty("repoKey", targetRepoKey)
setProperty("snapshotRepoKey", targetRepoKey)
setProperty(
"username",
project.properties["bintrayUser"] ?: System.getenv("BINTRAY_USER")
)
setProperty(
"password",
project.properties["bintrayApiKey"] ?: System.getenv("BINTRAY_API_KEY")
)
setProperty("maven", true)
})
defaults(delegateClosureOf<groovy.lang.GroovyObject> {
invokeMethod("publications", "mavenJava")
})
})
resolve(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig> {
setProperty("repoKey", "repo")
})
}

tasks.artifactoryPublish {
publications("mavenJar")
signing {
useGpgCmd()
isRequired = true
sign(tasks.jar.get(), tasks["dokkaJar"])
sign(publishing.publications["mavenJar"])
}

tasks {
withType(com.jfrog.bintray.gradle.tasks.BintrayUploadTask::class.java) {
dependsOn(assemble)
}
withType(org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask::class.java) {
dependsOn(assemble)
}
tasks.withType<Sign>().configureEach {
onlyIf { gradle.taskGraph.hasTask("${project.path}:publish") }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package radar.spring.auth.common

import org.radarcns.auth.exception.TokenValidationException
import org.radarcns.auth.token.RadarToken
import org.radarbase.auth.exception.TokenValidationException
import org.radarbase.auth.token.RadarToken
import javax.servlet.http.HttpServletRequest

interface RadarAuthValidator : AuthValidator<RadarToken> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package radar.spring.auth.managementportal

import org.radarcns.auth.authentication.TokenValidator
import org.radarcns.auth.config.TokenValidatorConfig
import org.radarcns.auth.config.TokenVerifierPublicKeyConfig
import org.radarcns.auth.exception.TokenValidationException
import org.radarcns.auth.token.RadarToken
import org.radarbase.auth.authentication.TokenValidator
import org.radarbase.auth.config.TokenValidatorConfig
import org.radarbase.auth.config.TokenVerifierPublicKeyConfig
import org.radarbase.auth.exception.TokenValidationException
import org.radarbase.auth.token.RadarToken
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
Expand Down Expand Up @@ -45,4 +45,4 @@ class ManagementPortalAuthValidator @JvmOverloads constructor(
companion object {
private val logger = LoggerFactory.getLogger(ManagementPortalAuthValidator::class.java)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package radar.spring.auth.managementportal

import org.radarcns.auth.authorization.Permission
import org.radarcns.auth.token.RadarToken
import org.radarbase.auth.authorization.Permission
import org.radarbase.auth.token.RadarToken
import org.slf4j.LoggerFactory
import radar.spring.auth.common.Authorization
import radar.spring.auth.common.PermissionOn
Expand Down Expand Up @@ -115,4 +115,4 @@ class ManagementPortalAuthorization : Authorization<RadarToken> {
companion object {
private val logger = LoggerFactory.getLogger(ManagementPortalAuthorization::class.java)
}
}
}

0 comments on commit 6443d36

Please sign in to comment.