Android studio app:
build.grade 是如何执行?
下面 并不是 Gradle 执行周期,仅仅是脚本的初始化的时候,把所有的设置加载了一遍!





// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' //2 artifactory (制定版本) classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { //1 自己私有服务器的依赖库 (如果你用本地的可以不用写的) maven { url "IP/artifactory/libs-release-local" } jcenter() } } task clean(type: Delete) { delete rootProject.buildDir}
apply plugin: 'com.android.library'apply plugin: 'com.jfrog.artifactory'apply plugin: 'maven-publish'
def packageName = 'com.chow.ui'def libraryVersion = '1.0.2-release'
artifactory {
contextUrl = 'IP//artifactory' publish {
repository {
// The Artifactory repository key to publish to repoKey = libraryVersion.endsWith('SNAPSHOT') ? 'libs-snapshot-local' : 'libs-release-local'
username = artifactory_username password = artifactory_password }
defaults {
// Tell the Artifactory Plugin which artifacts should be published to Artifactory. publications('aar')
publishArtifacts = true
// Properties to be attached to the published artifacts. properties = ['qa.level': 'basic', 'dev.team': 'core']
// Publish generated POM files to Artifactory (true by default) publishPom = true }
}
}





buildTypes {
debug {
applicationIdSuffix project.APP_IS_DEBUG multiDexEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }
}
mkdir -p ~/opt/packages/gradle && cd $_
wget https://services.gradle.org/distributions/gradle-2.3-bin.zip
unzip gradle-2.3-bin.zip
ln -s ~/opt/packages/gradle/gradle-2.3/ ~/opt/gradle
.profile file in vi, emacs, or gedit.gedit ~/.profile
.profile file.# Gradle
if [ -d "$HOME/opt/gradle" ]; then
export GRADLE_HOME="$HOME/opt/gradle"
PATH="$PATH:$GRADLE_HOME/bin"
fi
.profile and test gradle.source ~/.profile
which gradle
gradle -version
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle
include ':app', ':extras:ShimmerAndroid'