Skip to content

Modern gradle #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from 8 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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.txt text

# Override default behavior: BAT files always have CRLF line endings.
*.bat text eol=crlf
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@ 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 build number is specified in the `build.gradle` file:
The build number is specified in the `buildSrc/src/main/kotlin/ds3-java-sdk-library-convention.gradle.kts` file:

```
allprojects {
group = 'com.spectralogic.ds3'
version = '5.4.0'
}
group = "com.spectralogic.ds3"
version = "5.4.1"
```

When a release is created in github, it is automatically published on [jitpack.io](https://jitpack.io/#SpectraLogic/ds3_java_sdk).
2 changes: 1 addition & 1 deletion SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ If using Eclipse:

If using Intellij:
* Open Intellij and select `Import Project`
* Find the `build.gradle` file contained at the root of the project and select it
* Find the `settings.gradle.kts` file contained at the root of the project and select it
* Accept the defaults
101 changes: 0 additions & 101 deletions build.gradle

This file was deleted.

11 changes: 8 additions & 3 deletions settings.gradle → buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ******************************************************************************
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
* 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
*
Expand All @@ -13,5 +13,10 @@
* ****************************************************************************
*/

include 'ds3-sdk-integration', 'ds3-sdk', 'ds3-sdk-samples', 'ds3-interfaces', 'ds3-metadata', 'ds3-utils'
rootProject.name = 'ds3-java-sdk'
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* ******************************************************************************
* 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 {
`java`
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ******************************************************************************
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
* 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
*
Expand All @@ -13,10 +13,15 @@
* ****************************************************************************
*/

apply plugin: 'application'
plugins {
`java-library`
}

mainClassName = 'com.spectralogic.ds3client.samples.PartialObjectGetExample'
group = "com.spectralogic.ds3"
version = "5.4.1"

dependencies {
compile "org.slf4j:slf4j-simple:$slf4jVersion"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ******************************************************************************
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
* 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
*
Expand All @@ -13,4 +13,6 @@
* ****************************************************************************
*/

apply from: "$rootDir/gradle/scripts/publish.gradle"
plugins {
`ds3-java-sdk-library-convention`
}
51 changes: 0 additions & 51 deletions ds3-metadata/build.gradle

This file was deleted.

60 changes: 60 additions & 0 deletions ds3-metadata/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* ******************************************************************************
* 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.
* ****************************************************************************
*/

// bug in IntelliJ in which `libs` shows up as not being accessible
// see https://youtrack.jetbrains.com/issue/KTIJ-19369
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
`ds3-java-sdk-library-convention`
alias(libs.plugins.shadowPlugin)
}

dependencies {
api(project(":ds3-interfaces"))

implementation(project(":ds3-utils"))

implementation(libs.guava)
implementation(libs.jna)
implementation(libs.jnaPlatform)
implementation(libs.slf4jApi)

testImplementation(libs.commonsIo)
testImplementation(libs.commonsLang)
testImplementation(libs.httpclient)
testImplementation(libs.junit)

testRuntimeOnly(libs.slf4jSimple)
}

tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
relocate("org.apache", "ds3metafatjar.org.apache")
relocate("com.google", "ds3metafatjar.com.google")
relocate("com.sun.jna", "ds3metafatjar.net.java.dev.jna")
relocate("org.jetbrains", "ds3metafatjar.org.jetbrains")
relocate("org.intellij", "ds3metafatjar.org.intellij")
relocate("org.codehaus", "ds3metafatjar.org.codehaus")
dependencies {
exclude(project(":ds3-interfaces")) // this is being excluded since it must be used with the sdk, which already has this dependency included
exclude(project(":ds3-utils")) // this is being excluded since it must be used with the sdk, which already has this dependency included
exclude(dependency(libs.slf4jApi.get().toString()))
exclude(dependency(libs.slf4jSimple.get().toString()))
exclude(dependency(libs.hamcrest.get().toString()))
exclude(dependency(libs.mockitoCore.get().toString()))
exclude(dependency(libs.junit.get().toString()))
exclude(dependency(libs.commonsLang.get().toString()))
}
dependsOn(tasks.jar)
}
34 changes: 34 additions & 0 deletions ds3-sdk-integration/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* ******************************************************************************
* 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 {
`ds3-java-sdk-internal-convention`
}

dependencies {
implementation(project(":ds3-utils"))
implementation(project(":ds3-sdk"))

implementation(libs.commonsIo)
implementation(libs.guava)
implementation(libs.slf4jApi)
implementation(libs.hamcrest)
implementation(libs.junit)

testImplementation(project(":ds3-metadata"))

testImplementation(libs.httpclient)
testImplementation(libs.commonsLang)
}
Loading