Menjelajahi file build.gradle

Di hierarki proyek, cari Gradle Scripts dan luaskan. Ada beberapa file build.gradle. Satu dengan arahan untuk seluruh proyek dan satu untuk setiap modul aplikasi. Modul untuk aplikasi Anda disebut “app”. Pada tampilan Proyek, modul ini diwakili oleh folder app di tingkat atas tampilan Proyek. (Berwarna Kuning), dan Buka build.gradle (Module.app). (Berwarna Biru)

// Add Android-specific build tasks
apply plugin: 'com.android.application'
// Configure Android specific build options.
android {
    // Specify the target SDK version for the build.
   compileSdkVersion 23
   // The version of the build tools to use.
   buildToolsVersion "23.0.2"
   // Core settings and entries. Overrides manifest settings!
   defaultConfig {
       applicationId "com.example.hello.helloworld"
       minSdkVersion 15
       targetSdkVersion 23
       versionCode 1
       versionName "1.0"
   }
   // Controls how app is built and packaged.
   buildTypes {
       // Another common option is debug, which is not signed by default.
       release {
           // Code shrinker. Turn this on for production along with
           //  shrinkResources.
           minifyEnabled false
           // Use ProGuard, a Java optimizer.
           proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
   }
}
// This is the part you are most likely to change as you start using
// other libraries.
dependencies {
   // Local binary dependency. Include any JAR file inside app/libs.
   compile fileTree(dir: 'libs', include: ['*.jar'])
   // Configuration for unit tests.
   testCompile 'junit:junit:4.12'
   // Remote binary dependency. Specify Maven coordinates of the Support
   // Library needed. Use the SDK Manager to download and install such
   // packages.
   compile 'com.android.support:appcompat-v7:23.2.1'
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Just another Telkom University Student Blog site