Closed lovelejess closed 5 years ago
Never mind I think I figured it out! haha thanks :)
@lovelejess : Can you please share your solution? I am facing same issue and also new to gradle. I need to call something like this: appCenterUploadBetaRelease.dependsOn runMsBuild Thanks!!!
I realized that the app center task I was looking for was wrong. It generates a custom task based on what name you provide in the flavorDimensions in the app/build.gradle (I think).
Since my flavorDimension is Beta, it generated a task called:
appCenterUploadBetaRelease
Here's my build.gradle for the app:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
apply plugin: 'com.betomorrow.appcenter'
Properties properties = new Properties()
try {
properties.load(project.rootProject.file("local.properties").newDataInputStream())
} catch(Exception e) {
// do nothing. if file doesn't exist, then environment variables will be used below.
}
def appVersionCode = Integer.valueOf(properties.getProperty("version.code",System.getenv("CI_PIPELINE_ID")))
def appVersionName = properties.getProperty("version.name",System.getenv("SAMPLE_APP_VERSION_NAME"))
def distributionGroup = properties.getProperty("distributionGroup",System.getenv("DISTRIBUTION_GROUP"))
def appCenterAPIToken = properties.getProperty("appCenterAPIToken",System.getenv("APP_CENTER_API_TOKEN"))
android {
signingConfigs {
sampledistro {
...
}
}
compileSdkVersion 28
defaultConfig {
applicationId ""
minSdkVersion 19
targetSdkVersion 28
versionCode appVersionCode
versionName appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// release notes
ext.betaDistributionReleaseNotesFilePath="release_notes.txt"
// add group aliases
ext.betaDistributionGroupAliases=distributionGroup
signingConfig signingConfigs.sampledistro
}
}
flavorDimensions "beta"
productFlavors {
beta {
dimension "beta"
applicationIdSuffix ".beta"
versionNameSuffix "-beta"
}
}
dataBinding {
enabled = true
}
}
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath "gradle.plugin.com.betomorrow.gradle:appcenter-plugin:1.1.4"
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
api('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
transitive = true;
}
implementation project(':androidkitelibrary-debug')
}
// Generates Plugin Task: appCenterUploadBetaRelease
// Run: ./gradlew appCenterUploadBetaRelease
appcenter {
apiToken = appCenterAPIToken
ownerName = "owner"
distributionGroups = [distributionGroup]
releaseNotes = file("../release-notes.md")
notifyTesters = true
apps {
beta {
dimension = "beta"
appName = "App-Android-Beta"
}
}
}
Hope that helps!! Let me know if there's anything I can try to clarify for you. I'm also learning, so apologies if it doesn't totally make sense.
Hello! I'm unable to see the plugin tasks listed in the README. I am able to see other tasks from other plugins like Crashlytics.
I believe that I'm looking for the following tasks:
but I don't find them in the list of tasks when I run the command
./gradlew tasks --all
Here's my
build.gradle
Here's my
app/build.gradle
Here's the output of the command
./gradlew tasks --all
Tasks runnable from root project
Android tasks
app:androidDependencies - Displays the Android dependencies of the project. app:signingReport - Displays the signing info for the base and test modules app:sourceSets - Prints out all the source sets defined in this project.
Build tasks
app:assemble - Assemble main outputs for all the variants. app:assembleAndroidTest - Assembles all the Test applications. app:build - Assembles and tests this project. app:buildDependents - Assembles and tests this project and all projects that depend on it. app:buildNeeded - Assembles and tests this project and all projects it depends on. app:bundle - Assemble bundles for all the variants. app:clean - Deletes the build directory. app:cleanBuildCache - Deletes the build cache directory. app:compileDebugAndroidTestSources app:compileDebugSources app:compileDebugUnitTestSources app:compileReleaseSources app:compileReleaseUnitTestSources
Build Setup tasks
init - Initializes a new Gradle build. wrapper - Generates Gradle wrapper files.
Cleanup tasks
app:lintFix - Runs lint on all variants and applies any safe suggestions to the source code.
Help tasks
buildEnvironment - Displays all buildscript dependencies declared in root project 'sample'. androidkitelibrary-debug:buildEnvironment - Displays all buildscript dependencies declared in project ':androidkitelibrary-debug'. app:buildEnvironment - Displays all buildscript dependencies declared in project ':app'. components - Displays the components produced by root project 'sample'. [incubating] androidkitelibrary-debug:components - Displays the components produced by project ':androidkitelibrary-debug'. [incubating] app:components - Displays the components produced by project ':app'. [incubating] dependencies - Displays all dependencies declared in root project 'sample'. androidkitelibrary-debug:dependencies - Displays all dependencies declared in project ':androidkitelibrary-debug'. app:dependencies - Displays all dependencies declared in project ':app'. dependencyInsight - Displays the insight into a specific dependency in root project 'sample'. androidkitelibrary-debug:dependencyInsight - Displays the insight into a specific dependency in project ':androidkitelibrary-debug'. app:dependencyInsight - Displays the insight into a specific dependency in project ':app'. dependentComponents - Displays the dependent components of components in root project 'sample'. [incubating] androidkitelibrary-debug:dependentComponents - Displays the dependent components of components in project ':androidkitelibrary-debug'. [incubating] app:dependentComponents - Displays the dependent components of components in project ':app'. [incubating] help - Displays a help message. androidkitelibrary-debug:help - Displays a help message. app:help - Displays a help message. model - Displays the configuration model of root project 'sample'. [incubating] androidkitelibrary-debug:model - Displays the configuration model of project ':androidkitelibrary-debug'. [incubating] app:model - Displays the configuration model of project ':app'. [incubating] projects - Displays the sub-projects of root project 'sample'. androidkitelibrary-debug:projects - Displays the sub-projects of project ':androidkitelibrary-debug'. app:projects - Displays the sub-projects of project ':app'. properties - Displays the properties of root project 'sample'. androidkitelibrary-debug:properties - Displays the properties of project ':androidkitelibrary-debug'. app:properties - Displays the properties of project ':app'. tasks - Displays the tasks runnable from root project 'sample' (some of the displayed tasks may belong to subprojects). androidkitelibrary-debug:tasks - Displays the tasks runnable from project ':androidkitelibrary-debug'. app:tasks - Displays the tasks runnable from project ':app'.
Install tasks
app:installDebug - Installs the Debug build. app:installDebugAndroidTest - Installs the android (on device) tests for the Debug build. app:installRelease - Installs the Release build. app:uninstallAll - Uninstall all applications. app:uninstallDebug - Uninstalls the Debug build. app:uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build. app:uninstallRelease - Uninstalls the Release build.
What am I missing? I'm totally new to gradle so please bear with me. Thank you for making this awesome plugin. Excited to use it.