Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepan Kashintsev committed Sep 19, 2023
2 parents 5c4e98a + 8b1e233 commit 1137e83
Show file tree
Hide file tree
Showing 92 changed files with 4,040 additions and 382 deletions.
14 changes: 7 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include:
file: 'common/sonarqube.gitlab-ci.yml'
- project: 'integrator1/devops/gitlab-ci-jobs'
ref: master
file: 'common/build-gradle.gitlab-ci.yml'
file: 'common/build-gradle.gitlab-ci.yml'

stages:
- tests
Expand All @@ -22,15 +22,15 @@ stages:
expire_in: 1 week
name: "${CI_COMMIT_SHORT_SHA}_${CI_JOB_ID}"
reports:
junit: "**/test-results/test/*.xml"
junit: "**/test-results/test/*.xml"
paths:
- "**/build/reports/detekt/detekt.xml"
- "**/test-results/test/*.xml"
- "**/build/jacocoReports/test/jacocoTestReport.xml"
- images.json
- images.json
- "**/build/libs"

# check code quality
# check code quality
code_quality:
extends:
- .check_code_quality
Expand All @@ -39,9 +39,9 @@ code_quality:
- dev
- merge_requests
- /^.*rc.*$/
- /^.*release.*$/
- /^.*release.*$/
- /^.*hotfix.*$/

tests&build:
extends:
- .test-gradle
Expand Down Expand Up @@ -76,6 +76,6 @@ tests-mr:
- git checkout $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- git pull
- git merge origin/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
- ./gradlew -PmavenUser=$MAVEN_USER -PmavenPassword=$MAVEN_PASSWORD check build
- ./gradlew -PweMavenUser=$MAVEN_USER -PweMavenPassword=$MAVEN_PASSWORD check build
- docker images --format "{{json . }}" --no-trunc > images.json
<<: *artifacts
664 changes: 597 additions & 67 deletions README.md

Large diffs are not rendered by default.

171 changes: 81 additions & 90 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,39 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val kotlinVersion: String by project
val kotlinCoroutinesVersion: String by project
val reactorVersion: String by project
val springBootVersion: String by project
val springCloudVersion: String by project
val jacocoToolVersion: String by project
val logbackVersion: String by project
val javaxAnnotationApiVersion: String by project
val caffeineCacheVersion: String by project

val ioGrpcVersion: String by project
val ioGrpcKotlinVersion: String by project
val protobufVersion: String by project

val junitPlatformLauncherVersion: String by project
val junitBom: String by project
val mockkVersion: String by project
val springMockkVersion: String by project
val wireMockVersion: String by project

val ktorVersion: String by project

val weMavenUser: String? by project
val weMavenPassword: String? by project

val sonaTypeMavenUser: String? by project
val sonaTypeMavenPassword: String? by project

val weMavenBasePath = "https://artifacts.wavesenterprise.com/repository/"
val weMavenBasePath: String by project

val sonaTypeBasePath = "https://s01.oss.sonatype.org"
val gitHubProject = "waves-enterprise/we-node-client"
val githubUrl = "https://github.com/$gitHubProject"
val sonaTypeBasePath: String by project
val gitHubProject: String by project
val githubUrl: String by project

val feignVersion: String by project
val jacksonModuleKotlin: String by project

val weNodeClientVersion: String by project
val weContractSdkVersion: String by project

val aspectjVersion: String by project

val kotlinCoroutinesVersion: String by project

plugins {
kotlin("jvm") apply false
`maven-publish`
Expand Down Expand Up @@ -77,13 +75,70 @@ allprojects {
repositories {
mavenCentral()
mavenLocal()
if (weMavenUser != null && weMavenPassword != null) {
maven {
name = "we-snapshots"
url = uri("https://artifacts.wavesenterprise.com/repository/maven-snapshots/")
mavenContent {
snapshotsOnly()
}
credentials {
username = weMavenUser
password = weMavenPassword
}
}
}
}
}

subprojects {
apply(plugin = "maven-publish")

publishing {
repositories {
if (weMavenUser != null && weMavenPassword != null) {
maven {
name = "WE-artifacts"
afterEvaluate {
url = uri(
"$weMavenBasePath${
if (project.version.toString()
.endsWith("-SNAPSHOT")
) "maven-snapshots" else "maven-releases"
}"
)
}
credentials {
username = weMavenUser
password = weMavenPassword
}
}
}

if (sonaTypeMavenPassword != null && sonaTypeMavenUser != null) {
maven {
name = "SonaType-maven-central-staging"
val releasesUrl = uri("$sonaTypeBasePath/service/local/staging/deploy/maven2/")
afterEvaluate {
url = if (version.toString()
.endsWith("SNAPSHOT")
) throw kotlin.Exception("shouldn't publish snapshot") else releasesUrl
}
credentials {
username = sonaTypeMavenUser
password = sonaTypeMavenPassword
}
}
}
}
}
}

configure(
subprojects.filter { it.name != "we-sdk-spring-bom" }
) {
apply(plugin = "io.spring.dependency-management")
apply(plugin = "kotlin")
apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "io.gitlab.arturbosch.detekt")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
Expand Down Expand Up @@ -143,41 +198,6 @@ subprojects {
}

publishing {
repositories {
if (weMavenUser != null && weMavenPassword != null) {
maven {
name = "WE-artifacts"
afterEvaluate {
url = uri("$weMavenBasePath${
if (project.version.toString()
.endsWith("-SNAPSHOT")
) "maven-snapshots" else "maven-releases"
}")
}
credentials {
username = weMavenUser
password = weMavenPassword
}
}
}

if (sonaTypeMavenPassword != null && sonaTypeMavenUser != null) {
maven {
name = "SonaType-maven-central-staging"
val releasesUrl = uri("$sonaTypeBasePath/service/local/staging/deploy/maven2/")
afterEvaluate {
url = if (version.toString()
.endsWith("SNAPSHOT")
) throw kotlin.Exception("shouldn't publish snapshot") else releasesUrl
}
credentials {
username = sonaTypeMavenUser
password = sonaTypeMavenPassword
}
}
}
}

publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
Expand All @@ -193,8 +213,8 @@ subprojects {
pom {
packaging = "jar"
name.set(project.name)
url.set(githubUrl)
description.set("WE Node Client for Java/Kotlin")
url.set(githubUrl + gitHubProject)
description.set("WE starter for Java/Kotlin")

licenses {
license {
Expand All @@ -204,9 +224,9 @@ subprojects {
}

scm {
connection.set("scm:$githubUrl")
connection.set("scm:$githubUrl$gitHubProject")
developerConnection.set("scm:[email protected]:$gitHubProject.git")
url.set(githubUrl)
url.set(githubUrl + gitHubProject)
}

developers {
Expand All @@ -216,9 +236,9 @@ subprojects {
email.set("[email protected]")
}
developer {
id.set("bekirev")
name.set("Artem Bekirev")
email.set("abekirev@gmail.com")
id.set("donyfutura")
name.set("Daniil Georgiev")
email.set("donyfutura@gmail.com")
}
}
}
Expand All @@ -236,47 +256,18 @@ subprojects {

the<DependencyManagementExtension>().apply {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion")
mavenBom("org.springframework.boot:spring-boot-dependencies:$springBootVersion") {
bomProperty("kotlin.version", kotlinVersion)
}
mavenBom("com.wavesenterprise:we-node-client-bom:$weNodeClientVersion")
mavenBom("com.wavesenterprise:we-contract-sdk-bom:$weContractSdkVersion")
mavenBom("io.github.openfeign:feign-bom:$feignVersion")
mavenBom("org.junit:junit-bom:$junitBom")
}
dependencies {
dependency("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$kotlinCoroutinesVersion")
dependency("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$kotlinCoroutinesVersion")
dependency("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$kotlinCoroutinesVersion")

dependency("javax.annotation:javax.annotation-api:$javaxAnnotationApiVersion")

dependency("io.projectreactor:reactor-core:$reactorVersion")

dependency("com.google.protobuf:protobuf-java:$protobufVersion")
dependency("io.grpc:grpc-core:$ioGrpcVersion")
dependency("io.grpc:grpc-stub:$ioGrpcVersion")
dependency("io.grpc:grpc-netty:$ioGrpcVersion")
dependency("io.grpc:grpc-protobuf:$ioGrpcVersion")

dependency("com.google.protobuf:protobuf-kotlin:$protobufVersion")
dependency("io.grpc:grpc-kotlin-stub:$ioGrpcKotlinVersion")

dependency("ch.qos.logback:logback-classic:$logbackVersion")

dependency("io.ktor:ktor-client-core:$ktorVersion")
dependency("io.ktor:ktor-client-cio:$ktorVersion")
dependency("io.ktor:ktor-client-logging:$ktorVersion")
dependency("io.ktor:ktor-client-content-negotiation:$ktorVersion")
dependency("io.ktor:ktor-serialization-jackson:$ktorVersion")

dependency("io.github.openfeign:feign-core:$feignVersion")
dependency("io.github.openfeign:feign-jackson:$feignVersion")
dependency("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonModuleKotlin")
dependency("com.github.ben-manes.caffeine:caffeine:$caffeineCacheVersion")

dependency("org.junit.platform:junit-platform-launcher:$junitPlatformLauncherVersion")
dependency("io.mockk:mockk:$mockkVersion")
dependency("com.ninja-squad:springmockk:$springMockkVersion")
dependency("com.github.tomakehurst:wiremock-jre8:$wireMockVersion")
}
}

Expand Down
26 changes: 26 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plugins {
`java-gradle-plugin`
`kotlin-dsl`
kotlin("jvm") version "1.5.21"
}

group = "com.wavesenterprise.sdk.spring.plugin"
version = "1.0"

repositories {
mavenCentral()
}


gradlePlugin {
plugins {
create("optionalDependencyPlugin") {
id = "com.wavesenterprise.sdk.spring.plugin.optional"
implementationClass = "com.wavesenterprise.sdk.spring.plugin.optional.OptionalDependenciesPlugin"
}
}
}

dependencies {
implementation(kotlin("stdlib"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.wavesenterprise.sdk.spring.plugin.optional

import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer


/**
* OptionalDependenciesPlugin from spring-boot
* @see org.springframework.boot.build.optional.OptionalDependenciesPlugin
*/
class OptionalDependenciesPlugin : Plugin<Project> {
override fun apply(project: Project) {
val optional: Configuration = project.getConfigurations().create(OPTIONAL_CONFIGURATION_NAME)
optional.setCanBeConsumed(false)
optional.setCanBeResolved(false)
project.getPlugins().withType(JavaPlugin::class.java) {
val sourceSets: SourceSetContainer =
project.getExtensions().getByType(JavaPluginExtension::class.java).getSourceSets()
sourceSets.all {
project.getConfigurations().getByName(this.compileClasspathConfigurationName).extendsFrom(optional)
project.getConfigurations().getByName(this.runtimeClasspathConfigurationName).extendsFrom(optional)
}
}
}

companion object {
private const val OPTIONAL_CONFIGURATION_NAME = "optional"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
implementation-class=com.wavesenterprise.sdk.spring.plugin.optional.OptionalDependenciesPlugin
Loading

0 comments on commit 1137e83

Please sign in to comment.