संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Gradle के लिए Android प्लग इन, वर्शन 1.3.0 (जुलाई 2015)
डिपेंडेंसी:
सामान्य जानकारी:
-
com.android.build.threadPoolSize
प्रॉपर्टी के लिए सहायता जोड़ी गई है. इससे gradle.properties
फ़ाइल या कमांड लाइन से, Android
टास्क थ्रेड पूल के साइज़ को कंट्रोल किया जा सकता है. यहां दिए गए उदाहरण में, इस प्रॉपर्टी को 4 पर सेट किया गया है.
-Pcom.android.build.threadPoolSize=4
- डिफ़ॉल्ट बिल्ड के तरीके को इस तरह सेट करें कि APK से
LICENSE
और LICENSE.txt
फ़ाइलों को हटाया जा सके. इन फ़ाइलों को किसी APK में शामिल करने के लिए, build.gradle
फ़ाइल में मौजूद packagingOptions.excludes
प्रॉपर्टी से इन फ़ाइलों को हटाएं.
उदाहरण के लिए:
android {
packagingOptions.excludes = []
}
android {
packagingOptions.excludes.clear()
}
- सभी उपलब्ध सोर्स सेट की जांच करने के लिए,
sourceSets
टास्क जोड़ा गया.
- यूनिट टेस्ट की बेहतर सुविधा, ताकि मल्टी-फ़्लेवर और
बिल्ड वैरिएंट सोर्स फ़ोल्डर को पहचाना जा सके. उदाहरण के लिए, अगर आपको
Debug
बिल्ड टाइप के साथ, अलग-अलग फ़्लेवर वाले ऐप्लिकेशन flavor1
और flavorA
की जांच करनी है, तो टेस्ट सोर्स सेट ये होंगे:
- जांच
- testFlavor1
- testFlavorA
- testFlavor1FlavorA
- testFlavor1FlavorADebug
Android टेस्ट, पहले से ही एक से ज़्यादा फ़्लेवर वाले सोर्स फ़ोल्डर को पहचानते हैं.
- यूनिट टेस्ट के लिए बेहतर सहायता, ताकि:
- मुख्य और टेस्ट सोर्स पर
javac
चलाएं. भले ही, आपकी बिल्ड फ़ाइल में useJack
प्रॉपर्टी को true
पर सेट किया गया हो.
- हर बिल्ड टाइप के लिए, डिपेंडेंसी को सही तरीके से पहचानना.
- कमांड लाइन से इंस्ट्रुमेंटेशन टेस्ट-रनर के आर्ग्युमेंट तय करने की सुविधा जोड़ी गई.
उदाहरण के लिए:
./gradlew connectedCheck
-Pandroid.testInstrumentationRunnerArguments.size=medium
-Pandroid.testInstrumentationRunnerArguments.class=TestA,TestB
build.gradle
फ़ाइल में, Android ऐप्लिकेशन के लिए ऐसेट पैकेजिंग टूल (AAPT) के अतिरिक्त पैरामीटर के लिए सहायता जोड़ी गई है. उदाहरण के लिए:
android {
aaptOptions {
additionalParameters "--custom_option", "value"
}
}
android {
aaptOptions {
additionalParameters += listOf("--custom_option", "value")
}
}
-
टेस्ट APK मॉड्यूल के लिए सहायता जोड़ी गई है. इसका इस्तेमाल अलग टेस्ट मॉड्यूल के तौर पर किया जा सकता है. साथ ही,
targetProjectPath
और targetVariant
प्रॉपर्टी का इस्तेमाल करके, APK पाथ और टारगेट वैरिएंट सेट किया जा सकता है.
ध्यान दें: टेस्ट APK मॉड्यूल, प्रॉडक्ट फ़्लेवर के साथ काम नहीं करता. साथ ही, यह सिर्फ़ एक वैरिएंट को टारगेट कर सकता है. साथ ही, Jacoco का इस्तेमाल अभी नहीं किया जा सकता.
- संसाधनों को मर्ज करने से पहले, संसाधन के नाम की पुष्टि करने की सुविधा जोड़ी गई.
- लाइब्रेरी मॉड्यूल के लिए AAR (Android ARchive) पैकेज बनाते समय, मेनिफ़ेस्ट मर्जर सेटिंग में अपने-आप बनने वाले
@{applicationId}
प्लेसहोल्डर का इस्तेमाल न करें.
इसके बजाय, किसी दूसरे प्लेसहोल्डर का इस्तेमाल करें. जैसे, @{libApplicationId}
. साथ ही, अगर आपको संग्रह लाइब्रेरी में ऐप्लिकेशन आईडी शामिल करने हैं, तो इसके लिए वैल्यू दें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-08-30 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-30 (UTC) को अपडेट किया गया."],[],[],null,["\u003cbr /\u003e\n\nAndroid plugin for Gradle, revision 1.3.0 (July 2015)\n\n**Dependencies:**\n\n| | Minimum version | Default version | Notes |\n|----------------:|:---------------:|:---------------:|:----------------------------------------------------------------------------------------------------------:|\n| Gradle | 2.2.1 | 2.2.1 | To learn more, see [updating Gradle](/build/releases/gradle-plugin?buildsystem=ndk-build#updating-gradle). |\n| SDK Build Tools | 21.1.1 | 21.1.1 | [Install](/studio/intro/update#sdk-manager) or [configure](/tools/releases/build-tools) SDK Build Tools. |\n\n**General Notes:**\n\n- Added support for the `com.android.build.threadPoolSize`\n property to control the `Android` task thread pool size from\n the `gradle.properties` file or the command line. The\n following example sets this property to 4.\n\n \n -Pcom.android.build.threadPoolSize=4\n \n \n- Set the default build behavior to exclude `LICENSE` and `LICENSE.txt` files from APKs. To include these files in an APK, remove these files from the `packagingOptions.excludes` property in the `build.gradle` file. For example: \n\n ```groovy\n android {\n packagingOptions.excludes = []\n }\n \n ``` \n\n ```kotlin\n android {\n packagingOptions.excludes.clear()\n }\n \n ```\n- Added the `sourceSets` task to inspect the set of all available source sets.\n- Enhanced unit test support to recognize multi-flavor and [build variant](/tools/building/configuring-gradle#workBuildVariants) source folders. For example, to test an app with multi-flavors `flavor1` and `flavorA` with the `Debug` build type, the test source sets are:\n - test\n - testFlavor1\n - testFlavorA\n - testFlavor1FlavorA\n - testFlavor1FlavorADebug\n\n Android tests already recognized multi-flavor source folders.\n- Improved unit test support to:\n - Run `javac` on main and test sources, even if the `useJack` property is set to `true` in your build file.\n - Correctly recognize dependencies for each build type.\n- Added support for specifying instrumentation test-runner arguments from the command line. For example: \n\n ```\n ./gradlew connectedCheck \n\n -Pandroid.testInstrumentationRunnerArguments.size=medium \n\n -Pandroid.testInstrumentationRunnerArguments.class=TestA,TestB\n \n ```\n- Added support for arbitrary additional Android Asset Packaging Tool (AAPT) parameters\n in the `build.gradle` file. For example:\n\n ```groovy\n android {\n aaptOptions {\n additionalParameters \"--custom_option\", \"value\"\n }\n }\n \n ``` \n\n ```kotlin\n android {\n aaptOptions {\n additionalParameters += listOf(\"--custom_option\", \"value\")\n }\n }\n \n ```\n- Added support for a [test APK module](/tools/studio/studio-features#test-module) as a separate test module, using the `targetProjectPath` and `targetVariant` properties to set the APK path and target variant.\n\n **Note:** A test APK module does not support product\n flavors and can only target a single variant. Also, Jacoco is not supported yet.\n- Added resource name validation before merging resources.\n- When building an AAR (Android ARchive) package for library modules, do not provide an automatic `@{applicationId}` placeholder in the [manifest merger](/tools/building/manifest-merge) settings. Instead, use a different placeholder, such as `@{libApplicationId}` and provide a value for it if you want to include application Ids in the archive library.\n\n\u003cbr /\u003e"]]