2021-08-15 07:13:06 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2021 dorkbox, llc
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License 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.
|
|
|
|
*/
|
2019-06-24 16:42:03 +02:00
|
|
|
|
|
|
|
import java.time.Instant
|
|
|
|
|
2020-09-19 22:09:35 +02:00
|
|
|
///////////////////////////////
|
|
|
|
////// PUBLISH TO SONATYPE / MAVEN CENTRAL
|
|
|
|
////// TESTING : (to local maven repo) <'publish and release' - 'publishToMavenLocal'>
|
|
|
|
////// RELEASE : (to sonatype/maven central), <'publish and release' - 'publishToSonatypeAndRelease'>
|
|
|
|
///////////////////////////////
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2021-08-15 07:13:06 +02:00
|
|
|
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS // always show the stacktrace!
|
|
|
|
gradle.startParameter.warningMode = WarningMode.All
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2021-08-15 07:13:06 +02:00
|
|
|
plugins {
|
|
|
|
id("com.dorkbox.GradleUtils") version "2.9"
|
|
|
|
id("com.dorkbox.Licensing") version "2.9.2"
|
|
|
|
id("com.dorkbox.VersionUpdate") version "2.4"
|
|
|
|
id("com.dorkbox.GradlePublish") version "1.11"
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2021-08-15 07:13:06 +02:00
|
|
|
kotlin("jvm") version "1.5.21"
|
|
|
|
kotlin("kapt") version "1.5.21"
|
2019-06-24 16:42:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
object Extras {
|
|
|
|
// set for the project
|
2019-06-25 21:11:16 +02:00
|
|
|
const val description = "Cloudflare API v4 for Kotlin"
|
2019-06-24 16:42:03 +02:00
|
|
|
const val group = "com.dorkbox"
|
2021-08-15 07:13:06 +02:00
|
|
|
const val version = "1.4"
|
2019-06-24 16:42:03 +02:00
|
|
|
|
|
|
|
// set as project.ext
|
|
|
|
const val name = "KloudflareAPI"
|
|
|
|
const val id = "KloudflareAPI"
|
|
|
|
const val vendor = "Dorkbox LLC"
|
2020-09-19 22:09:35 +02:00
|
|
|
const val vendorUrl = "https://dorkbox.com"
|
2019-06-24 16:42:03 +02:00
|
|
|
const val url = "https://git.dorkbox.com/dorkbox/KloudflareAPI"
|
2021-08-15 07:13:06 +02:00
|
|
|
|
2019-06-24 16:42:03 +02:00
|
|
|
val buildDate = Instant.now().toString()
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
///// assign 'Extras'
|
|
|
|
///////////////////////////////
|
|
|
|
GradleUtils.load("$projectDir/../../gradle.properties", Extras)
|
2021-08-15 07:13:06 +02:00
|
|
|
GradleUtils.defaults()
|
2020-12-26 23:34:45 +01:00
|
|
|
GradleUtils.compileConfiguration(JavaVersion.VERSION_11)
|
2019-06-24 16:42:03 +02:00
|
|
|
|
|
|
|
licensing {
|
|
|
|
license(License.APACHE_2) {
|
|
|
|
author(Extras.vendor)
|
|
|
|
url(Extras.url)
|
|
|
|
note(Extras.description)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
setSrcDirs(listOf("src"))
|
|
|
|
|
|
|
|
// want to include java and kotlin files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java", "**/*.kt")
|
|
|
|
}
|
|
|
|
}
|
2019-07-28 15:00:22 +02:00
|
|
|
|
|
|
|
test {
|
|
|
|
java {
|
|
|
|
setSrcDirs(listOf("test"))
|
|
|
|
|
|
|
|
// want to include java and kotlin files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java", "**/*.kt")
|
|
|
|
}
|
|
|
|
}
|
2019-06-24 16:42:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.jar.get().apply {
|
|
|
|
manifest {
|
2019-07-28 16:37:56 +02:00
|
|
|
// https://docs.oracle.com/javase/tutorial/deployment/jar/packageman.html
|
|
|
|
attributes["Name"] = Extras.name
|
|
|
|
|
|
|
|
attributes["Specification-Title"] = Extras.name
|
|
|
|
attributes["Specification-Version"] = Extras.version
|
|
|
|
attributes["Specification-Vendor"] = Extras.vendor
|
|
|
|
|
|
|
|
attributes["Implementation-Title"] = "${Extras.group}.${Extras.id}"
|
|
|
|
attributes["Implementation-Version"] = Extras.buildDate
|
|
|
|
attributes["Implementation-Vendor"] = Extras.vendor
|
|
|
|
|
|
|
|
attributes["Automatic-Module-Name"] = Extras.id
|
2019-06-24 16:42:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
|
2021-08-15 07:13:06 +02:00
|
|
|
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2021-08-15 07:13:06 +02:00
|
|
|
val moshiVer = "1.12.0"
|
|
|
|
val okHttpVer = "4.9.1"
|
2020-12-26 23:34:45 +01:00
|
|
|
val retroVer = "2.9.0"
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2022-11-27 21:31:06 +01:00
|
|
|
api("com.squareup.okhttp3:okhttp:$okHttpVer")
|
|
|
|
api("com.squareup.okhttp3:logging-interceptor:$okHttpVer") // Log Network Calls
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2020-01-04 20:16:10 +01:00
|
|
|
// better SSL library
|
2022-11-27 21:31:06 +01:00
|
|
|
api("org.conscrypt:conscrypt-openjdk-uber:2.5.2")
|
2020-01-04 20:16:10 +01:00
|
|
|
|
2019-06-24 16:42:03 +02:00
|
|
|
// For serialization. THESE ARE NOT TRANSITIVE because it screws up the kotlin version
|
2022-11-27 21:31:06 +01:00
|
|
|
api("com.squareup.retrofit2:retrofit:$retroVer")
|
|
|
|
api("com.squareup.retrofit2:converter-moshi:$retroVer")
|
2020-01-06 14:36:39 +01:00
|
|
|
|
2022-11-27 21:31:06 +01:00
|
|
|
api("com.squareup.moshi:moshi:$moshiVer")
|
|
|
|
api("com.squareup.moshi:moshi-kotlin:$moshiVer")
|
2020-01-06 14:36:39 +01:00
|
|
|
|
2022-11-27 21:31:06 +01:00
|
|
|
api("com.dorkbox:Updates:1.1")
|
2021-08-15 07:13:06 +02:00
|
|
|
|
2020-01-06 14:36:39 +01:00
|
|
|
// for AUTOMATIC kotlin reflective serialization of json classes
|
|
|
|
kapt ("com.squareup.moshi:moshi-kotlin-codegen:$moshiVer")
|
|
|
|
kaptTest ("com.squareup.moshi:moshi-kotlin-codegen:$moshiVer")
|
2019-07-28 16:37:56 +02:00
|
|
|
}
|
|
|
|
|
2020-09-19 22:09:35 +02:00
|
|
|
publishToSonatype {
|
|
|
|
groupId = Extras.group
|
|
|
|
artifactId = Extras.id
|
|
|
|
version = Extras.version
|
2020-01-04 20:16:10 +01:00
|
|
|
|
2020-09-19 22:09:35 +02:00
|
|
|
name = Extras.name
|
|
|
|
description = Extras.description
|
|
|
|
url = Extras.url
|
2020-01-04 20:16:10 +01:00
|
|
|
|
2020-09-19 22:09:35 +02:00
|
|
|
vendor = Extras.vendor
|
|
|
|
vendorUrl = Extras.vendorUrl
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2020-09-19 22:09:35 +02:00
|
|
|
issueManagement {
|
|
|
|
url = "${Extras.url}/issues"
|
|
|
|
nickname = "Gitea Issues"
|
2019-07-28 16:37:56 +02:00
|
|
|
}
|
2019-06-24 16:42:03 +02:00
|
|
|
|
2020-09-19 22:09:35 +02:00
|
|
|
developer {
|
|
|
|
id = "dorkbox"
|
|
|
|
name = Extras.vendor
|
|
|
|
email = "email@dorkbox.com"
|
2019-07-28 16:37:56 +02:00
|
|
|
}
|
2019-06-24 16:42:03 +02:00
|
|
|
}
|