java-sdk/lib/build.gradle

124 lines
3.5 KiB
Groovy

/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.4.2/userguide/building_java_projects.html
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id "io.freefair.lombok" version "6.4.3"
id 'pmd'
id 'maven-publish'
id 'signing'
id 'jacoco'
}
pmd {
pmdTest.enabled = false
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
implementation 'org.slf4j:slf4j-log4j12:1.7.29'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:30.1.1-jre'
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
testImplementation 'org.mockito:mockito-core:4+'
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
}
tasks.named('test') {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = true
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
archiveBaseName = 'openfeature'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
jar.archiveBaseName = 'openfeature'
def repo_url = System.getenv("REPOSITORY_URL")
group = 'dev.openfeature'
version = '0.0.1' + (Boolean.valueOf(System.getProperty("release")) ? "" : "-SNAPSHOT")
publishing {
publications {
maven(MavenPublication) {
artifactId="javasdk"
from components.java
artifact sourcesJar
pom {
name = 'OpenFeature SDK'
packaging = 'jar'
// optionally artifactId can be defined here
description 'A library to abstract feature flagging across many providers'
url = 'https://openfeature.dev'
scm {
connection = 'scm:git:https://github.com/openfeature/java-sdk.git'
developerConnection = 'scm:git:https://github.com/openfeature/java-sdk.git'
url = 'https://github.com/openfeature/java-sdk'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'abrahms'
name = 'Justin Abrahms'
email = 'jabrahms@ebay.com'
}
}
}
}
}
repositories {
maven {
credentials {
username = project.findProperty('ossrhUsername') ?: 'anon'
password = project.findProperty('ossrhPassword') ?: 'no-op'
}
url = repo_url
}
}
}