From 8a95adc3925bb0d54529f5215ca5223b09978d5e Mon Sep 17 00:00:00 2001 From: Carl Poole Date: Thu, 4 May 2023 17:58:26 -0500 Subject: [PATCH] chore(android): add publishing code to screen-orientation plugin --- screen-orientation/android/build.gradle | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/screen-orientation/android/build.gradle b/screen-orientation/android/build.gradle index 678f01255..5c68e3e8d 100644 --- a/screen-orientation/android/build.gradle +++ b/screen-orientation/android/build.gradle @@ -1,4 +1,5 @@ ext { + capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' @@ -12,10 +13,18 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:8.0.0' + if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { + classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' + } } } apply plugin: 'com.android.library' +if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { + apply plugin: 'io.github.gradle-nexus.publish-plugin' + apply from: file('../../scripts/android/publish-root.gradle') + apply from: file('../../scripts/android/publish-module.gradle') +} android { namespace "com.capacitorjs.plugins.screenorientation" @@ -50,7 +59,13 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':capacitor-android') + + if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { + implementation "com.capacitorjs:core:$capacitorVersion" + } else { + implementation project(':capacitor-android') + } + implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" testImplementation "junit:junit:$junitVersion" androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"