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
96 changes: 96 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
version: 2.1

orbs:
win: circleci/windows@5.0.0

workflows:
test:
jobs:
- build-linux
- test-linux:
name: Java 8 - Linux - OpenJDK
docker-image: cimg/openjdk:8.0
requires:
- build-linux
- test-linux:
name: Java 11 - Linux - OpenJDK
docker-image: cimg/openjdk:11.0
requires:
- build-linux
- test-linux:
# current LTS version
name: Java 17 - Linux - OpenJDK
docker-image: cimg/openjdk:17.0
with-coverage: true
requires:
- build-linux
- test-linux:
name: Java 19 - Linux - OpenJDK
docker-image: cimg/openjdk:19.0
requires:
- build-linux
- packaging:
requires:
- build-linux

jobs:
build-linux:
docker:
- image: cimg/openjdk:8.0
steps:
- checkout
- run: java -version
- run: ./gradlew dependencies
- run: ./gradlew jar
- persist_to_workspace:
root: build
paths:
- classes

test-linux:
parameters:
docker-image:
type: string
with-coverage:
type: boolean
default: false
docker:
- image: <<parameters.docker-image>>
steps:
- checkout
- attach_workspace:
at: build
- run: java -version
- run:
name: Run tests
command: ./gradlew test
- run:
name: Save test results
command: |
mkdir -p ~/junit/
find . -type f -regex ".*/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
when: always

- store_test_results:
path: ~/junit
- store_artifacts:
path: ~/junit
- store_artifacts:
path: ./build/reports/jacoco/test/html
destination: coverage

packaging:
docker:
- image: cimg/openjdk:8.0
steps:
- run: java -version
- run: sudo apt-get install make -y -q
- checkout
- attach_workspace:
at: build
- run:
name: checkstyle/javadoc
command: ./gradlew javadoc checkstyleMain
- run:
name: Publish to local maven
command: ./gradlew publishToMavenLocal
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ This version of the LaunchDarkly provider works with Java 8 and above.

### Installation

TODO: Implement
First, install the LaunchDarkly OpenFeature provider for the Server-Side SDK for Java as a dependency in your application using your application's dependency manager.

```xml
<dependency>
<groupId>com.launchdarkly</groupId>
<artifactId>launchdarkly-openfeature-serverprovider</artifactId>
<version>0.1.0</version> <!-- use current version number -->
</dependency>
```

```groovy
implementation group: 'com.launchdarkly', name: 'launchdarkly-openfeature-serverprovider', version: '0.1.0'
// Use current version number in place of 0.1.0.
```

### Usage

Expand Down
108 changes: 91 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,93 @@
/*
* This build 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 Java Libraries chapter in the Gradle
* user guide available at https://docs.gradle.org/4.4.1/userguide/java_library_plugin.html
*/

// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'

// In this section you declare where to find the dependencies of your project

plugins {
id "java"
id "java-library"
id "checkstyle"
id "jacoco"
id "signing"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "maven-publish"
id "io.github.gradle-nexus.publish-plugin" version '1.2.0'
id "idea"
}

java {
withJavadocJar()
withSourcesJar()
}

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

test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
showStandardStreams = true
exceptionFormat = 'full'
}
dependsOn 'cleanTest'
finalizedBy jacocoTestReport // report is always generated after tests run
}

jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}

checkstyle {
toolVersion = "9.3"
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
checkstyleTest.enabled = false
}

publishing {
publications {
mavenJava(MavenPublication) { publication ->
from components.java

artifactId = 'launchdarkly-openfeature-serverprovider'

pom {
name = 'LaunchDarkly OpenFeature provider for the Server-Side SDK for Java'
packaging = 'jar'
url = 'https://github.com/launchdarkly/openfeature-java-server'

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
name = 'LaunchDarkly SDK Team'
email = 'sdks@launchdarkly.com'
}
}

scm {
connection = 'scm:git:git://github.com/launchdarkly/openfeature-java-server'
developerConnection = 'scm:git:ssh:git@github.com:launchdarkly/openfeature-java-server.git'
url = 'https://github.com/launchdarkly/openfeature-java-server'
}
}
}
}
repositories {
mavenLocal()
}
}

nexusPublishing {
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
repositories {
sonatype {
username = ossrhUsername
password = ossrhPassword
}
}
}

dependencies {
Expand All @@ -23,8 +97,8 @@ dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:23.0'

implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: '6.0.0'
implementation 'dev.openfeature:sdk:1.2.0'
implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: '6.+'
implementation 'dev.openfeature:sdk:[1.2.0,2.0.0)'

// Use JUnit test framework
testImplementation 'junit:junit:4.12'
Expand Down
15 changes: 15 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="JavadocPackage"/>
<module name="TreeWalker">
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
</module>
<module name="JavadocType">
<property name="scope" value="public"/>
</module>
</module>
</module>
7 changes: 7 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
group = com.launchdarkly
version = 0.1.0-alpha.1
signing.keyId=
signing.password=
signing.secretKeyRingFile=
ossrhUsername=
ossrhPassword=
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ include 'api'
include 'services:webservice'
*/

rootProject.name = 'openfeature-java-server'
rootProject.name = 'launchdarkly-openfeature-serverprovider'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Main package for the LaunchDarkly OpenFeature provider for the Server-Side SDK for Java, containing the provider
* and configuration classes.
* <p>
* You will most often use {@link com.launchdarkly.openfeature.serverprovider.Provider} (the provider) and
* {@link com.launchdarkly.openfeature.serverprovider.ProviderConfiguration} (configuration options for the provider).
* <p>
*/
package com.launchdarkly.openfeature.serverprovider;