android:gradle
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| android:gradle [2013/07/29 22:35] – [What's Gradle] percy | android:gradle [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Android Gradle ====== | ====== Android Gradle ====== | ||
| + | Briefly, | ||
| + | And the Gradle script is written with Groovy([[wp> | ||
| + | |||
| + | Also it will provide a flexible way for customization, | ||
| + | |||
| + | Anyway,I hope it will be continuely improved, | ||
| ===== What's Gradle ===== | ===== What's Gradle ===== | ||
| Line 85: | Line 91: | ||
| The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead. | The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead. | ||
| </ | </ | ||
| - | ===== Gradle user guide ===== | + | =====Android  | 
| + | Gradle Plugin User Guide: | ||
| + | Gradle is an advanced build system as well as an advanced build toolkit allowing to create custom build logic through plugins. | ||
| - | ===== Gradle  | + | Here are some of its features that made us choose  | 
| + | * Domain Specific Language (DSL) to describe and manipulate the build logic | ||
| + | * Build files are Groovy based and allow mixing of declarative elements through the DSL and using code to manipulate the DSL elements to provide custom logic. | ||
| + | * Built-in dependency management through Maven and/or Ivy. | ||
| + | * Very flexible. Allows using best practices but doesn’t force its own way of doing things. | ||
| + | * Plugins can expose their own DSL and their own API for build files to use. | ||
| + | * Good Tooling API allowing IDE integration | ||
| + | |||
| + | ===== Gradle command ===== | ||
| + | Gradle Command Line : | ||
| ===== What's Groovy ===== | ===== What's Groovy ===== | ||
| + | Groovy: | ||
| + | [[wp> | ||
| + | |||
| + | < | ||
| + | Groovy... | ||
| + | * is an agile and dynamic language for the Java Virtual Machine | ||
| + | * builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk | ||
| + | * makes modern programming features available to Java developers with almost-zero learning curve | ||
| + | * provides the ability to statically type check and statically compile your code for robustness and performance | ||
| + | * supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain | ||
| + | * makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL | ||
| + | * increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications | ||
| + | * simplifies testing by supporting unit testing and mocking out-of-the-box | ||
| + | * seamlessly integrates with all existing Java classes and libraries | ||
| + | * compiles straight to Java bytecode so you can use it anywhere you can use Java | ||
| + | </ | ||
| ===== Gradle build script example ===== | ===== Gradle build script example ===== | ||
| + | <file Groovy build.grade> | ||
| + | buildscript { | ||
| + | repositories { | ||
| + | mavenCentral() | ||
| + | } | ||
| + | dependencies { | ||
| + |         classpath ' | ||
| + | } | ||
| + | } | ||
| + | |||
| + | apply plugin: ' | ||
| + | |||
| + | dependencies { | ||
| + |     compile files(' | ||
| + |      ' | ||
| + |      ' | ||
| + |      ' | ||
| + |      ' | ||
| + |      ' | ||
| + |      ' | ||
| + | ) | ||
| + | } | ||
| + | |||
| + | android { | ||
| + | compileSdkVersion 17 | ||
| + |     buildToolsVersion " | ||
| + | |||
| + | |||
| + | defaultConfig { | ||
| + | minSdkVersion 8 | ||
| + | targetSdkVersion 17 | ||
| + | } | ||
| + | |||
| + | sourceSets { | ||
| + | main { | ||
| + |             manifest.srcFile ' | ||
| + |             java.srcDirs = [' | ||
| + |             resources.srcDirs = [' | ||
| + |             aidl.srcDirs = [' | ||
| + |             renderscript.srcDirs = [' | ||
| + |             res.srcDirs = [' | ||
| + |             assets.srcDirs = [' | ||
| + | } | ||
| + | |||
| + |         instrumentTest.setRoot(' | ||
| + | } | ||
| + | |||
| + | signingConfigs { | ||
| + | debug { | ||
| + |             storeFile file(" | ||
| + | } | ||
| + | |||
| + | releaseConfig{ | ||
| + |             storeFile file(" | ||
| + |             storePassword " | ||
| + |             keyAlias " | ||
| + |             keyPassword " | ||
| + | } | ||
| + | } | ||
| + | |||
| + | buildTypes { | ||
| + | release { | ||
| + | runProguard true | ||
| + |             proguardFile getDefaultProguardFile(' | ||
| + | signingConfig signingConfigs.releaseConfig | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ====Basic Usage ==== | ||
| + | gradle assemble | ||
/var/www/dokuwiki/wiki/data/attic/android/gradle.1375108553.txt.gz · Last modified: 2016/05/05 13:06 (external edit)
                
                