Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4118)

Unified Diff: build/android/gradle/build.gradle.jinja

Issue 2130933002: 🎧 Initial version of Android Studio project generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 2 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/PRESUBMIT.py ('k') | build/android/gradle/generate_gradle.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gradle/build.gradle.jinja
diff --git a/build/android/gradle/build.gradle.jinja b/build/android/gradle/build.gradle.jinja
new file mode 100644
index 0000000000000000000000000000000000000000..406e730304115733752a0192c6c5cf04ef8a5c40
--- /dev/null
+++ b/build/android/gradle/build.gradle.jinja
@@ -0,0 +1,98 @@
+{# Copyright 2016 The Chromium Authors. All rights reserved. #}
+{# Use of this source code is governed by a BSD-style license that can be #}
+{# found in the LICENSE file. #}
+// Generated by //build/android/generate_gradle.py
+{% if template_type == 'root' %}
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:2.1.2"
+ }
+}
+
+{% elif template_type == 'java_library' %}
+
+apply plugin: "java"
+
+sourceSets {
+ main {
+ java.srcDirs = {{ java_dirs }}
+ }
+}
+
+sourceCompatibility = JavaVersion.VERSION_1_7
+targetCompatibility = JavaVersion.VERSION_1_7
+
+{% else %}
+
+{% if template_type == 'android_library' %}
+apply plugin: "com.android.library"
+{% elif template_type == 'android_apk' %}
+apply plugin: "com.android.application"
+{% endif %}
+
+android {
+ compileSdkVersion {{ compile_sdk_version }}
+ buildToolsVersion "{{ build_tools_version }}"
+ publishNonDefault true
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
+ }
+
+ sourceSets {
+ main {
+ manifest.srcFile "{{ android_manifest }}"
+ java.srcDirs = [
+{% for path in java_dirs %}
+ "{{ path }}",
+{% endfor %}
+ ]
+ resources.srcDirs = []
+ aidl.srcDirs = []
+ renderscript.srcDirs = []
+ res.srcDirs = []
+ assets.srcDirs = []
+ }
+ }
+}
+{% endif %}
+{% if template_type != 'root' %}
+
+dependencies {
+{% for path in prebuilts %}
+ compile files("{{ path }}")
+{% endfor %}
+{% for proj in java_project_deps %}
+ compile project(":{{ proj }}")
+{% endfor %}
+{% for proj in android_project_deps %}
+ debugCompile project(path: ":{{ proj }}", configuration: "debug")
+ releaseCompile project(path: ":{{ proj }}", configuration: "release")
+{% endfor %}
+}
+
+afterEvaluate {
+ def tasksToDisable = tasks.findAll {
+ return (it.name.equals('generateDebugSources') // causes unwanted AndroidManifest.java
+ || it.name.equals('generateReleaseSources')
+ || it.name.endsWith('Assets')
+ || it.name.endsWith('BuildConfig') // causes unwanted BuildConfig.java
+{% if not use_gradle_process_resources %}
+ || it.name.endsWith('Resources')
+ || it.name.endsWith('ResValues')
+{% endif %}
+ || it.name.endsWith('Aidl')
+ || it.name.endsWith('Renderscript')
+ || it.name.endsWith('Shaders'))
+ }
+ tasksToDisable.each { Task task ->
+ task.enabled = false
+ }
+}
+
+{% endif %}
« no previous file with comments | « build/android/PRESUBMIT.py ('k') | build/android/gradle/generate_gradle.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698