From 0dcee2b4f79686bccba386dc217302dd42d017f5 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Fri, 2 Jul 2021 20:31:33 +0200 Subject: [PATCH] Release 0.6.1 (#37) * Update MavenPublisher, remove jcenter, enable snapshots * Release v0.6.1 * Fix build issues --- .run/publishAllBintray.run.xml | 2 +- README.md | 14 ++--- build.gradle.kts | 12 ++-- demo/build.gradle.kts | 8 +-- demo/src/main/AndroidManifest.xml | 1 + .../opengl/demo/VideoActivity.kt | 6 +- docs/_about/changelog.md | 6 ++ docs/_config.yml | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- library/build.gradle.kts | 59 +++++++++---------- 10 files changed, 55 insertions(+), 57 deletions(-) diff --git a/.run/publishAllBintray.run.xml b/.run/publishAllBintray.run.xml index 4fe7f48..1ef2490 100644 --- a/.run/publishAllBintray.run.xml +++ b/.run/publishAllBintray.run.xml @@ -4,7 +4,7 @@ diff --git a/README.md b/README.md index 7beffe4..425e973 100644 --- a/README.md +++ b/README.md @@ -38,17 +38,17 @@ but other targets like iOS can probably be added easily. ```kotlin // Regular Android projects -implementation("com.otaliastudios.opengl:egloo-android:0.6.0") +implementation("com.otaliastudios.opengl:egloo-android:0.6.1") // Kotlin Multiplatform projects: add egloo-multiplatform to your common source set. -implementation("com.otaliastudios.opengl:egloo-multiplatform:0.6.0") +implementation("com.otaliastudios.opengl:egloo-multiplatform:0.6.1") // Kotlin Multiplatform projects: or use the granular dependencies: -implementation("com.otaliastudios.opengl:egloo-android:0.6.0") // Android AAR -implementation("com.otaliastudios.opengl:egloo-androidnativex86:0.6.0") // Android Native KLib -implementation("com.otaliastudios.opengl:egloo-androidnativex64:0.6.0") // Android Native KLib -implementation("com.otaliastudios.opengl:egloo-androidnativearm32:0.6.0") // Android Native KLib -implementation("com.otaliastudios.opengl:egloo-androidnativearm64:0.6.0") // Android Native KLib +implementation("com.otaliastudios.opengl:egloo-android:0.6.1") // Android AAR +implementation("com.otaliastudios.opengl:egloo-androidnativex86:0.6.1") // Android Native KLib +implementation("com.otaliastudios.opengl:egloo-androidnativex64:0.6.1") // Android Native KLib +implementation("com.otaliastudios.opengl:egloo-androidnativearm32:0.6.1") // Android Native KLib +implementation("com.otaliastudios.opengl:egloo-androidnativearm64:0.6.1") // Android Native KLib ``` ## Features diff --git a/build.gradle.kts b/build.gradle.kts index 2705c06..01b690e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,8 +6,8 @@ buildscript { repositories { google() mavenCentral() - jcenter() mavenLocal() + maven("../MavenPublisher/publisher/build/prebuilt") maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") } @@ -18,11 +18,9 @@ buildscript { } dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31") - classpath("com.android.tools.build:gradle:4.1.1") - classpath("io.deepmedia.tools:publisher:latest-SNAPSHOT") { - isChanging = true - } + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20") + classpath("com.android.tools.build:gradle:4.2.2") + classpath("io.deepmedia.tools:publisher:0.6.0") } } @@ -30,8 +28,6 @@ allprojects { repositories { google() mavenCentral() - jcenter() - // maven("https://dl.bintray.com/natario/multiplatform") } } diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index 56728fb..388254c 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -22,10 +22,10 @@ android { } dependencies { - implementation("androidx.appcompat:appcompat:1.2.0") - implementation("androidx.core:core-ktx:1.3.2") - implementation("com.google.android.exoplayer:exoplayer-core:2.13.2") - implementation("com.google.android.exoplayer:exoplayer-ui:2.13.2") + implementation("androidx.appcompat:appcompat:1.3.0") + implementation("androidx.core:core-ktx:1.6.0") + implementation("com.google.android.exoplayer:exoplayer-core:2.14.1") + implementation("com.google.android.exoplayer:exoplayer-ui:2.14.1") implementation(project(":library")) // For testing, instead of the project dependency: diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index c0b5bc5..1d2c329 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" + android:usesCleartextTraffic="true" tools:ignore="GoogleAppIndexingWarning"> diff --git a/demo/src/main/java/com/otaliastudios/opengl/demo/VideoActivity.kt b/demo/src/main/java/com/otaliastudios/opengl/demo/VideoActivity.kt index 8ba8f71..ee31b8a 100644 --- a/demo/src/main/java/com/otaliastudios/opengl/demo/VideoActivity.kt +++ b/demo/src/main/java/com/otaliastudios/opengl/demo/VideoActivity.kt @@ -13,7 +13,7 @@ import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view.* import android.widget.Toast -import com.google.android.exoplayer2.ExoPlayerFactory +import com.google.android.exoplayer2.MediaItem import com.google.android.exoplayer2.SimpleExoPlayer import com.google.android.exoplayer2.source.ProgressiveMediaSource import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory @@ -74,12 +74,12 @@ class VideoActivity : AppCompatActivity(), GLSurfaceView.Renderer { setContentView(R.layout.activity_video) // Set up the player - player = ExoPlayerFactory.newSimpleInstance(this) + player = SimpleExoPlayer.Builder(this).build() val dataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, "Egloo")) val videoSource = ProgressiveMediaSource.Factory(dataSourceFactory) // .createMediaSource(Uri.parse("https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")) - .createMediaSource(Uri.parse("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")) + .createMediaSource(MediaItem.fromUri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")) player.prepare(videoSource) player.playWhenReady = true diff --git a/docs/_about/changelog.md b/docs/_about/changelog.md index 9a2599e..26d7eed 100644 --- a/docs/_about/changelog.md +++ b/docs/_about/changelog.md @@ -9,6 +9,11 @@ New versions are released through GitHub, so the reference page is the [GitHub R Starting from v0.3.1, you can [support development](https://github.com/sponsors/natario1) through the GitHub Sponsors program. Companies can share a tiny part of their revenue and get private support hours in return. Thanks! +### v0.6.1 + +- Upgrade to Kotlin 1.5.20 ([#37][37]) +- Enable snapshot releases ([#37][37]) + ### v0.6.0 - Upgrade to Kotlin 1.4.31 ([#33][33]) @@ -88,3 +93,4 @@ First versioned release. [23]: https://github.com/natario1/Egloo/pull/23 [31]: https://github.com/natario1/Egloo/pull/31 [33]: https://github.com/natario1/Egloo/pull/33 +[37]: https://github.com/natario1/Egloo/pull/37 diff --git a/docs/_config.yml b/docs/_config.yml index 0760b13..bcccb93 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -12,7 +12,7 @@ google_analytics_id: 'UA-155077779-3' google_site_verification: '4x49i17ABIrSvUl52SeL0-t0341aTnWWaC62-FYCRT4' github: [metadata] # TODO What's this? github_repo: Egloo -github_version: 0.6.0 +github_version: 0.6.1 github_branch: master baseurl: '/Egloo' # Keep as an empty string if served up at the root collections: diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5bba726..e4908f0 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-6.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip diff --git a/library/build.gradle.kts b/library/build.gradle.kts index e48afb3..bd705d9 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -13,37 +13,29 @@ plugins { id("io.deepmedia.tools.publisher") } -fun KotlinMultiplatformExtension.newSourceSet(name: String, vararg parents: KotlinSourceSet): KotlinSourceSet { - return sourceSets.maybeCreate(name).apply { - parents.forEach { dependsOn(it) } - } -} - -// Ideally we'd have common -> androidNative -> androidNative32/64 -> androidNativeXXX, but the -// commonizer currently only works on sets whose direct children are the final targets. -// So we need to move androidNative closer to the final targets and create two chains instead: -// 1. common -> androidNative -----------------------> androidNativeXXX -// 2. \------> androidNative32/64 -------/ // https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html fun KotlinMultiplatformExtension.androidNative(name: String = "androidNative", configure: KotlinNativeTarget.() -> Unit) { val commonMain = sourceSets["commonMain"] val commonTest = sourceSets["commonTest"] - val androidNativeMain = newSourceSet("${name}Main", commonMain) - val androidNativeTest = newSourceSet("${name}Test", commonTest) - val androidNative32BitMain = newSourceSet("${name}32BitMain", androidNativeMain) - val androidNative64BitMain = newSourceSet("${name}64BitMain", androidNativeMain) - val androidNative32BitTest = newSourceSet("${name}32BitTest", androidNativeTest) - val androidNative64BitTest = newSourceSet("${name}64BitTest", androidNativeTest) + + val androidNativeMain = sourceSets.create("${name}Main") { dependsOn(commonMain) } + val androidNativeTest = sourceSets.create("${name}Test") { dependsOn(commonTest) } + + val androidNative32BitMain = sourceSets.create("${name}32BitMain") { dependsOn(androidNativeMain) } + val androidNative64BitMain = sourceSets.create("${name}64BitMain") { dependsOn(androidNativeMain) } + val androidNative32BitTest = sourceSets.create("${name}32BitTest") { dependsOn(androidNativeTest) } + val androidNative64BitTest = sourceSets.create("${name}64BitTest") { dependsOn(androidNativeTest) } + val targets32 = listOf(androidNativeX86(), androidNativeArm32()) val targets64 = listOf(androidNativeX64(), androidNativeArm64()) targets32.forEach { - newSourceSet(it.compilations["main"].defaultSourceSetName, androidNativeMain, androidNative32BitMain) - newSourceSet(it.compilations["test"].defaultSourceSetName, androidNativeTest, androidNative32BitTest) + it.compilations["main"].defaultSourceSet.dependsOn(androidNative32BitMain) + it.compilations["test"].defaultSourceSet.dependsOn(androidNative32BitTest) it.configure() } targets64.forEach { - newSourceSet(it.compilations["main"].defaultSourceSetName, androidNativeMain, androidNative64BitMain) - newSourceSet(it.compilations["test"].defaultSourceSetName, androidNativeTest, androidNative64BitTest) + it.compilations["main"].defaultSourceSet.dependsOn(androidNative64BitMain) + it.compilations["test"].defaultSourceSet.dependsOn(androidNative64BitTest) it.configure() } } @@ -62,7 +54,7 @@ kotlin { sourceSets { getByName("androidJvmMain") { dependencies { - api("androidx.annotation:annotation:1.1.0") + api("androidx.annotation:annotation:1.2.0") } } configureEach { @@ -82,7 +74,7 @@ android { defaultConfig { setMinSdkVersion(property("androidMinSdkVersion") as Int) setTargetSdkVersion(property("androidTargetSdkVersion") as Int) - versionName = "0.6.0" + versionName = "0.6.1" } buildTypes["release"].consumerProguardFile("proguard-rules.pro") sourceSets["main"].java.srcDirs("src/androidJvmMain/kotlin") @@ -103,7 +95,6 @@ publisher { project.scm = GithubScm("natario1", "Egloo") project.addLicense(License.MIT) project.addDeveloper("natario1", "mat.iavarone@gmail.com") - release.docs = Release.DOCS_AUTO val dir = "../prebuilt" // Kotlin creates MavenPublication objects with a specific name. @@ -122,36 +113,38 @@ publisher { multiplatformPublications.forEach { (mavenPublication, artifactId) -> deployLocally.dependsOn("publishToDirectory${mavenPublication.capitalize()}") directory(mavenPublication) { + setPublication(mavenPublication, clone = true) directory = dir - publication = mavenPublication project.name = artifactId project.artifact = artifactId + release.docs = Release.DOCS_AUTO } deploySonatypeReleases.dependsOn("publishToSonatype${mavenPublication.capitalize()}") sonatype(mavenPublication) { + setPublication(mavenPublication, clone = true) auth.user = "SONATYPE_USER" auth.password = "SONATYPE_PASSWORD" signing.key = "SIGNING_KEY" signing.password = "SIGNING_PASSWORD" - publication = mavenPublication project.name = artifactId project.artifact = artifactId + release.docs = Release.DOCS_AUTO } - // TODO can't work, version overrides the other sonatype version! Need to fix this in publisher plugin - /* deploySonatypeSnapshots.dependsOn("publishToSonatype${mavenPublication.capitalize()}Snapshot") + deploySonatypeSnapshots.dependsOn("publishToSonatype${mavenPublication.capitalize()}Snapshot") sonatype(mavenPublication + "Snapshot") { + setPublication(mavenPublication, clone = true) repository = Sonatype.OSSRH_SNAPSHOT_1 release.version = "latest-SNAPSHOT" auth.user = "SONATYPE_USER" auth.password = "SONATYPE_PASSWORD" signing.key = "SIGNING_KEY" signing.password = "SIGNING_PASSWORD" - publication = mavenPublication project.name = artifactId project.artifact = artifactId - } */ + release.docs = Release.DOCS_AUTO + } } // Legacy android release (:egloo) @@ -161,6 +154,7 @@ publisher { component = "release" project.name = "Egloo" project.artifact = "egloo" + release.docs = Release.DOCS_AUTO release.sources = Release.SOURCES_AUTO } @@ -173,11 +167,12 @@ publisher { component = "release" project.name = "Egloo" project.artifact = "egloo" + release.docs = Release.DOCS_AUTO release.sources = Release.SOURCES_AUTO } } -/* afterEvaluate { +afterEvaluate { val publishing = project.publishing publishing.publications.filterIsInstance().forEach { println("Analyzing publication ${it.name}...") @@ -185,4 +180,4 @@ publisher { println(" - artifact ext=${it.extension} classifier=${it.classifier}") } } -} */ +}