Skip to content

Commit

Permalink
chore(android): add publishing code to screen-orientation plugin (#1578)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlpoole authored May 4, 2023
1 parent 139c18b commit c1cae58
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion screen-orientation/android/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c1cae58

Please sign in to comment.