Skip to content

Commit

Permalink
Merge branch 'master' into TLSForce
Browse files Browse the repository at this point in the history
  • Loading branch information
scribe authored Oct 2, 2023
2 parents 9f39ebe + dfd72ae commit edb78c7
Show file tree
Hide file tree
Showing 445 changed files with 1,420 additions and 809 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
distribution: 'temurin'
java-version: '8'
check-latest: true
- run: ./gradlew clean classes testClasses integrationTestClasses --refresh-dependencies
- run: ./gradlew clean classes testClasses integrationTestClasses shadowJar --refresh-dependencies
test:
name: Test with multiple Temurin JDK versions
strategy:
Expand All @@ -34,4 +34,4 @@ jobs:
- name: Compile and assemble main project with Temurin JDK ${{ matrix.test-jdk-version }}
run: ./gradlew clean assemble
- name: Test with Temurin JDK ${{ matrix.test-jdk-version }}
run: ./gradlew -S test
run: ./gradlew -S test${{ matrix.test-jdk-version }}
68 changes: 32 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
ds3_java_sdk
============

[![Build Status](https://travis-ci.com/SpectraLogic/ds3_java_sdk.svg)](https://travis-ci.com/SpectraLogic/ds3_java_sdk)
<a href="https://scan.coverity.com/projects/4624">
<img alt="Coverity Scan Build Status"
src="https://scan.coverity.com/projects/4624/badge.svg"/>
</a>
[ ![Download](https://api.bintray.com/packages/spectralogic/ds3/ds3-sdk/images/download.svg) ](https://bintray.com/spectralogic/ds3/ds3-sdk/_latestVersion)
[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/SpectraLogic/ds3_java_sdk/blob/master/LICENSE.md) [![Open Hub project report for ds3_java_sdk](https://www.openhub.net/p/ds3_java_sdk/widgets/project_thin_badge.gif)](https://www.openhub.net/p/ds3_java_sdk?ref=sample)
[![Latest release](https://img.shields.io/github/release/SpectraLogic/ds3_java_sdk.svg)](https://github.com/SpectraLogic/ds3_java_sdk/releases/latest)
[![Maven Central](https://img.shields.io/maven-central/v/com.spectralogic.ds3/ds3-bom.svg)](https://search.maven.org/artifact/com.spectralogic.ds3/ds3-bom)
[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/SpectraLogic/ds3_java_sdk/blob/master/LICENSE.md)
[![Open Hub project report for ds3_java_sdk](https://www.openhub.net/p/ds3_java_sdk/widgets/project_thin_badge.gif)](https://www.openhub.net/p/ds3_java_sdk?ref=sample)

## Contact Us

Expand All @@ -21,57 +18,53 @@ If using Intellij, simply import the project as a Gradle project.

## Install

To install the latest `ds3_java_sdk` either download the latest release jar file from the [Releases](../../releases) page or clone the repository with `git clone https://github.com/SpectraLogic/ds3_java_sdk.git`, cd to `ds3_java_sdk` and run `./gradlew clean ds3-sdk:install` to install the sdk into your local maven repository. It is compatible with Java 8.
To install the latest `ds3_java_sdk` either download the latest release jar file from the [Releases](../../releases) page or clone the repository with `git clone https://github.com/SpectraLogic/ds3_java_sdk.git`, cd to `ds3_java_sdk` and run `./gradlew clean ds3-sdk:install` to install the sdk into your local maven repository. It is compatible with Java 8 and is additionally tested against Java 11 and 17.

The SDK can also be included directly into a Maven or Gradle build. There is also a fatjar version that you can optionally use with the `all` classifier, take a look at the commented out code in the examples below. To include the SDK into maven add the following to the `pom.xml` file:
Starting with the 5.6.0 release, the SDK is available on [Maven Central](https://central.sonatype.com/namespace/com.spectralogic.ds3) and can be included directly into a Maven or Gradle build. There is also a fatjar version that you can optionally use with the `all` classifier, take a look at the commented out code in the examples below. To include the SDK into maven add the following to the `pom.xml` file:

```xml

<project>
...
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
...
<dependencies>
...
<dependency>
<groupId>com.github.spectralogic</groupId>
<artifactId>ds3_java_sdk</artifactId>
<groupId>com.spectralogic.ds3</groupId>
<artifactId>ds3-sdk</artifactId>
<version>Tag</version>
<!-- <classifier>all</classifier> -->
</dependency>
...
</dependencies>
</project>
```

To include the sdk into Gradle include the following in the `build.gradle.kts` file:

```kotlin
dependencies {
implementation(platform("com.spectralogic.ds3:ds3-bom:Tag"))
implementation("com.spectralogic.ds3:ds3-sdk")
//implementation("com.spectralogic.ds3:ds3-sdk::all")
}
```

To include the sdk into Gradle include the following in the `build.gradle` file:
or in the `build.gradle` file:

```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.spectralogic:ds3_java_sdk:Tag'
implementation 'com.github.spectralogic:ds3_java_sdk:Tag:all'
implementation platform('com.spectralogic.ds3:ds3-bom:Tag')
implementation 'com.spectralogic.ds3:ds3-sdk'
//implementation 'com.spectralogic.ds3:ds3-sdk::all'
}
```
## Javadoc

The latest javadoc is located at [http://spectralogic.github.io/ds3_java_sdk/javadoc/](http://spectralogic.github.io/ds3_java_sdk/javadoc/)
### Previous versions

Versions prior to 5.6.0 are available on [jitpack.io](https://jitpack.io/#SpectraLogic/ds3_java_sdk) under different maven coordinates. Unfortunately, the 5.6.0 version on jitpack.io is a pre-release version and is missing important fixes, and it is recommended that the artifacts on Maven Central are used going forward. To access versions earlier than 5.6.0, please see the instructions at https://jitpack.io/#SpectraLogic/ds3_java_sdk.

## Contributing

If you would like to contribute to the source code, sign the [Contributors Agreement](https://developer.spectralogic.com/contributors-agreement/) and make sure that your source conforms to our [Java Style Guide](https://github.com/SpectraLogic/spectralogic.github.com/wiki/Java-Style-Guide). For an overview of how we use Github, please review our [Github Workflow](https://github.com/SpectraLogic/spectralogic.github.com/wiki/Github-Workflow).

## Examples
Expand All @@ -98,11 +91,14 @@ Update the version of the SDK before creating a new release. The format is `<maj
`<major>.<minor>` numbers must match the version of BP. The `<patch>` is an incrementing number that increments with
each SDK release for a given major/minor release.

The version is specified in the `buildSrc/src/main/kotlin/ds3-java-sdk-version.gradle.kts` file:
The version is specified in `libs.versions.toml`:

```
group = "com.spectralogic.ds3"
version = "5.4.1"
[versions]
#
# project version
#
ds3SdkVersion = "5.6.1"
```

When a release is created in github, it is automatically published on [jitpack.io](https://jitpack.io/#SpectraLogic/ds3_java_sdk).
Once released, increment the minor version and add the suffix "-SNAPSHOT" to prepare for the next development cycle.
19 changes: 19 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* ******************************************************************************
* Copyright 2002 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/

tasks.wrapper {
// to upgrade the gradle wrapper, bump the version below and run ./gradlew wrapper twice
gradleVersion = "8.3"
}
8 changes: 3 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.owasp:dependency-check-gradle:7.3.2")
implementation(libs.kotlinJvmPlugin)
implementation(libs.owaspDepCheckPlugin)
implementation(libs.versionsPlugin)
}
19 changes: 19 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* ****************************************************************************
* Copyright 2023 Spectra Logic Corporation. All Rights Reserved.
* ***************************************************************************
*/

rootProject.name = "buildSrc"

dependencyResolutionManagement {
repositories {
mavenCentral()
gradlePluginPortal()
versionCatalogs {
create("libs") {
from(files("../libs.versions.toml"))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,12 @@
plugins {
`java`
`jacoco`
id("com.github.ben-manes.versions")
}

tasks.compileJava {
options.encoding = "UTF-8"
// since java 8 is the minimum version supported, make sure we always
// produce java 8 bytecode
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
options.release.set(8)
} else {
// java 8 does not have a release option, so use source and target compatibility
setSourceCompatibility(JavaVersion.VERSION_1_8.toString())
setTargetCompatibility(JavaVersion.VERSION_1_8.toString())
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

Expand All @@ -45,3 +39,20 @@ tasks.jacocoTestReport {
tasks.test {
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}

// convenience task name for github tests
tasks.register<Test>("test8") {
dependsOn(tasks.test)
}

tasks.register<Test>("test11") {
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(11))
})
}

tasks.register<Test>("test17") {
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(17))
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,46 @@
*/

plugins {
id("ds3-java-sdk-internal-convention")
id("ds3-java-sdk-version")
id("ds3-java-sdk-internal-convention")
id("org.jetbrains.kotlin.jvm")
`java-library`
`maven-publish`
id("ds3-java-sdk-publishing-common-convention")
signing
id("org.owasp.dependencycheck")
}

group = "com.spectralogic.ds3"
version = "5.4.1"
kotlin {
jvmToolchain {
(this as JavaToolchainSpec).apply {
languageVersion.set(JavaLanguageVersion.of("8"))
vendor.set(JvmVendorSpec.ADOPTIUM)
}
}
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("ProjectPublication") {
create<MavenPublication>("Project") {
from(components["java"])
}
}
}

signing {
setRequired({
(extra["isReleaseVersion"] as Boolean) && gradle.taskGraph.hasTask("publishProjectPublicationToOSSRHRepository")
})
useGpgCmd()
sign(publishing.publications["Project"])
}

dependencyCheck {
// fail the build if any vulnerable dependencies are identified (CVSS score > 0)
failBuildOnCVSS = 0f;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import org.gradle.api.publish.maven.MavenPublication

/*
* ******************************************************************************
* Copyright 2002 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/

plugins {
`maven-publish`
signing
}

publishing {
repositories {
maven {
name = "internal"
val releasesRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-releases/"
val snapshotsRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-snapshots/"
url = uri(if (extra["isReleaseVersion"] as Boolean) releasesRepoUrl else snapshotsRepoUrl)
credentials {
username = extra.has("artifactsUsername").let {
if (it) extra.get("artifactsUsername") as String else null
}
password = extra.has("artifactsPassword").let {
if (it) extra.get("artifactsPassword") as String else null
}
}
}
maven {
name = "OSSRH"
val releasesOssrhRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsOssrhRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = uri(if (extra["isReleaseVersion"] as Boolean) releasesOssrhRepoUrl else snapshotsOssrhRepoUrl)
credentials {
username = extra.has("ossrhUsername").let {
if (it) extra.get("ossrhUsername") as String else null
}
password = extra.has("ossrhPassword").let {
if (it) extra.get("ossrhPassword") as String else null
}
}
}
}
}

tasks.register("publishToInternalRepository") {
group = "publishing"
description = "Publishes all Maven publications to the internal Maven repository."
dependsOn(tasks.withType<PublishToMavenRepository>().matching {
it.repository == publishing.repositories["internal"]
})
}

tasks.register("publishToSonatypeOSSRH") {
group = "publishing"
description = "Publishes all Maven publications to Sonatype's OSSRH repository."
dependsOn(tasks.withType<PublishToMavenRepository>().matching {
it.repository == publishing.repositories["OSSRH"]
})
}

val augmentPom = tasks.register("augmentPom") {
publishing.publications.filterIsInstance<MavenPublication>().forEach { pub ->
pub.pom {
name.set("${project.group}:${project.name}")
url.set("https://github.com/SpectraLogic/ds3_java_sdk")
description.set("${project.description}")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
name.set("Spectra Logic Developers")
email.set("[email protected]")
organization.set("Spectra Logic")
organizationUrl.set("https://spectralogic.com/")
}
}
scm {
connection.set("scm:git:https://github.com/SpectraLogic/ds3_java_sdk.git")
developerConnection.set("scm:git:https://github.com/SpectraLogic/ds3_java_sdk.git")
url.set("https://github.com/SpectraLogic/ds3_java_sdk")
}
}
}
}

tasks.withType<GenerateMavenPom>().configureEach {
dependsOn(augmentPom)
}

tasks.withType<Sign>().configureEach {
onlyIf("isReleaseVersion is set") { project.extra["isReleaseVersion"] as Boolean }
}
Loading

0 comments on commit edb78c7

Please sign in to comment.