diff --git a/KalturaClient/build.gradle b/KalturaClient/build.gradle index 1138e141b..c827d1c3c 100644 --- a/KalturaClient/build.gradle +++ b/KalturaClient/build.gradle @@ -1,15 +1,21 @@ apply plugin: 'com.android.library' apply from: '../version.gradle' +apply plugin: 'kotlin-android' android { - compileSdkVersion 28 + compileSdkVersion 31 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 17 + targetSdkVersion 30 versionName kalturaClientVersion } + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + buildTypes { release { minifyEnabled false @@ -27,6 +33,8 @@ tasks.withType(Javadoc) { } dependencies { - implementation 'com.google.code.gson:gson:2.8.2' - implementation 'com.squareup.okhttp3:okhttp:3.12.1' + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.9.2' } + +apply from: './gradle-mvn-push.gradle' diff --git a/KalturaClient/gradle-mvn-push.gradle b/KalturaClient/gradle-mvn-push.gradle new file mode 100644 index 000000000..789c1358c --- /dev/null +++ b/KalturaClient/gradle-mvn-push.gradle @@ -0,0 +1,61 @@ +apply plugin: 'maven-publish' +apply plugin: 'signing' + +task androidSourcesJar(type: Jar) { + classifier 'sources' + from android.sourceSets.main.java.sourceFiles +} + +artifacts { + archives androidSourcesJar +} + +afterEvaluate { project -> + publishing { + publications { + mavenJava(MavenPublication) { + groupId = GROUP + artifactId = POM_ARTIFACT_ID + VERSION_NAME = kalturaClientVersion + version = VERSION_NAME + + from components.release + artifact androidSourcesJar + + pom { + name = POM_NAME + packaging = POM_PACKAGING + description = POM_DESCRIPTION + url = POM_URL + + licenses { + license { + name = POM_LICENCE_NAME + url = POM_LICENCE_URL + distribution = POM_LICENCE_DIST + } + } + developers { + developer { + id = POM_DEVELOPER_ID + name = POM_DEVELOPER_NAME + } + } + scm { + url = POM_SCM_URL + connection = POM_SCM_CONNECTION + developerConnection = POM_SCM_DEV_CONNECTION + } + } + } + } + } + + signing { + allprojects { ext."signing.keyId" = rootProject.ext["signingKeyId"] } + allprojects { ext."signing.password" = rootProject.ext["signingPassword"] } + allprojects { ext."signing.secretKeyRingFile" = SECRING_PATH } + sign publishing.publications + } +} + diff --git a/KalturaClient/gradle.properties b/KalturaClient/gradle.properties new file mode 100644 index 000000000..e33e80f56 --- /dev/null +++ b/KalturaClient/gradle.properties @@ -0,0 +1,20 @@ +POM_NAME=Kaltura Android Client Library +POM_ARTIFACT_ID=KalturaOttAndroidJavaClient +POM_PACKAGING=aar + +VERSION_NAME=kalturaClientVersion + +POM_DESCRIPTION=Kaltura OTT Android Java Client Library +POM_URL=https://github.com/kaltura/KalturaOttGeneratedAPIClientsAndroid/ + +POM_SCM_URL=https://github.com/kaltura/KalturaOttGeneratedAPIClientsAndroid/ +POM_SCM_CONNECTION=scm:git@https://github.com/kaltura/KalturaOttGeneratedAPIClientsAndroid.git +POM_SCM_DEV_CONNECTION=scm:git@https://github.com/kaltura/KalturaOttGeneratedAPIClientsAndroid.git + +POM_LICENCE_NAME=GNU Affero General Public License, Version 3.0 +POM_LICENCE_URL=https://www.gnu.org/licenses/agpl-3.0.html +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=playkitdev +POM_DEVELOPER_NAME=Playkit Dev + +SECRING_PATH=../.kltrenv/secring.gpg diff --git a/KalturaClient/src/main/java/com/kaltura/client/Client.java b/KalturaClient/src/main/java/com/kaltura/client/Client.java index f756823cb..321afca18 100644 --- a/KalturaClient/src/main/java/com/kaltura/client/Client.java +++ b/KalturaClient/src/main/java/com/kaltura/client/Client.java @@ -44,8 +44,8 @@ public class Client extends ClientBase { public Client(ConnectionConfiguration config) { super(config); - this.setClientTag("java:22-08-31"); - this.setApiVersion("8.0.0.30009"); + this.setClientTag("java:22-09-05"); + this.setApiVersion("8.0.0.30010"); this.clientConfiguration.put("format", 1); // JSON } diff --git a/build.gradle b/build.gradle index 275fc54c6..046f961cc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,46 @@ +apply plugin: 'io.github.gradle-nexus.publish-plugin' + +ext["nexusUserName"] = System.getenv('NEXUS_USERNAME') +ext["nexusPassword"] = System.getenv('NEXUS_PASSWORD') +ext["signingKeyId"] = System.getenv('SIGNING_KEYID') +ext["signingPassword"] = System.getenv('SIGNING_PASSWORD') +ext["GROUP"] = 'com.kaltura' + + buildscript { + ext.kotlin_version = '1.5.20' repositories { - jcenter() google() + mavenCentral() + maven { url 'https://jitpack.io' } } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.novoda:bintray-release:0.9' + classpath 'com.android.tools.build:gradle:7.0.3' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' } } allprojects { repositories { - jcenter() google() + mavenCentral() + maven { url 'https://jitpack.io' } + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} + +nexusPublishing { + repositories { + sonaType { + nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/")) + packageGroup = GROUP + username = nexusUserName + password = nexusPassword + } } } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..a066d344a --- /dev/null +++ b/gradle.properties @@ -0,0 +1,19 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8143641d6..30937dbed 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/version.gradle b/version.gradle index 8cf704dd2..f469c1f5a 100644 --- a/version.gradle +++ b/version.gradle @@ -6,22 +6,4 @@ // ./gradlew KalturaClient:bintrayUpload -PdryRun=false -PbintrayUser=$BINTRAY_USER -PbintrayKey=$BINTRAY_KEY // Library Version -ext.kalturaClientVersion = '8.0.0.30009' - -// Publish to Bintray -try { - apply plugin: 'bintray-release' - - publish { - artifactId = 'KalturaOttAndroidJavaClient' - desc = 'Kaltura OTT Android Java Client Library' - publishVersion = kalturaClientVersion - repoName = 'android' - userOrg = 'kaltura' - groupId = 'com.kaltura' - version = kalturaClientVersion - autoPublish = true - } -} catch (UnknownPluginException ignored) { - // Ignore - it's ok not to have this plugin - it's only used for bintray uploads. -} +ext.kalturaClientVersion = '8.0.0.30010'