Commit ab3426de authored by Anita Woodruff's avatar Anita Woodruff Committed by Commit Bot

Revert "[Cronet] Build maven modules and test by building sample app with gradle"

This reverts commit 10f4dd89.

Reason for revert: Build failures on 3 bots

BUG=838082

Original change's description:
> [Cronet] Build maven modules and test by building sample app with gradle
> 
> This change builds maven modules for Cronet.
> Each maven module includes:
>   1. POM file defining module and listing dependent modules
>   2. Jars
>   3. Proguard files (optional)
>   4. Native libraries (optional)
>   5. Resources (optional)
>   6. Javadocs (optional)
> We build four maven modules:
>   1. cronet-api: the Cronet API
>   2. cronet-embedded: the Cronet native implementation
>   3. cronet-fallback: the Cronet fallback implementation
>   4. cronet-common: Cronet implementation in common with #3 and #4
> 
> To test the maven modules, this change builds the Cronet sample app using gradle.
> You can install and run the resulting app by:
>   ninja -C out/Debug cronet_maven_test_build
>   adb install -r out/Debug/cronet_maven/test/build/outputs/apk/debug/test-debug.apk
>   adb install -r out/Debug/cronet_maven/test/build/outputs/apk/androidTest/debug/test-debug-androidTest.apk
>   adb shell am instrument -w org.chromium.cronet_sample_apk.test/android.support.test.runner.AndroidJUnitRunner
> 
> Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
> Change-Id: I5ed27e86f3e01dc3a6441ab449bbe942553343af
> Reviewed-on: https://chromium-review.googlesource.com/998019
> Commit-Queue: Paul Jensen <pauljensen@chromium.org>
> Reviewed-by: Andrei Kapishnikov <kapishnikov@chromium.org>
> Reviewed-by: Eric Stevenson <estevenson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#554608}

TBR=pauljensen@chromium.org,kapishnikov@chromium.org,estevenson@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I2779ce28f4df2b8dfe8dd2fcf5fc5a3a850c8ee0
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Reviewed-on: https://chromium-review.googlesource.com/1034534Reviewed-by: default avatarAnita Woodruff <awdf@chromium.org>
Commit-Queue: Anita Woodruff <awdf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554723}
parent a64fa182
......@@ -1510,7 +1510,6 @@ if (enable_java_templates) {
# proguard_configs: List of proguard configs (optional).
# android_manifest: Path to AndroidManifest.xml (optional).
# native_libraries: list of native libraries (optional).
# direct_deps_only: Do not recurse on deps. (optional, defaults false).
#
# Example
# dist_aar("my_aar") {
......@@ -1525,9 +1524,6 @@ if (enable_java_templates) {
_deps = invoker.deps
}
_direct_deps_only =
defined(invoker.direct_deps_only) && invoker.direct_deps_only
_build_config = "$target_gen_dir/$target_name.build_config"
_build_config_target_name = "${target_name}__build_config"
......@@ -1570,15 +1566,11 @@ if (enable_java_templates) {
rebase_path(depfile, root_build_dir),
"--output",
rebase_path(invoker.output, root_build_dir),
"--jars=@FileArg($_rebased_build_config:deps_info:javac_full_classpath)",
"--dependencies-res-zips=@FileArg($_rebased_build_config:resources:dependency_zips)",
"--r-text-files=@FileArg($_rebased_build_config:resources:extra_r_text_files)",
"--proguard-configs=@FileArg($_rebased_build_config:deps_info:proguard_all_configs)",
]
if (_direct_deps_only) {
args += [ "--jars=@FileArg($_rebased_build_config:javac:classpath)" ]
} else {
args += [ "--jars=@FileArg($_rebased_build_config:deps_info:javac_full_classpath)" ]
}
if (defined(invoker.android_manifest)) {
args += [
"--android-manifest",
......
This diff is collapsed.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.chromium.net</groupId>
<artifactId>cronet-api</artifactId>
<version>@MAJOR@.@MINOR@.@BUILD@.@PATCH@</version>
<packaging>aar</packaging>
<name>Cronet</name>
<description>Cronet API. Does not contain implementation.</description>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.chromium.net</groupId>
<artifactId>cronet-common</artifactId>
<version>@MAJOR@.@MINOR@.@BUILD@.@PATCH@</version>
<packaging>aar</packaging>
<name>Cronet</name>
<description>Cronet shared implementation. Not a complete implementation; apps and libraries should not depend on this target directly.</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cronet-api</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.chromium.net</groupId>
<artifactId>cronet-embedded</artifactId>
<version>@MAJOR@.@MINOR@.@BUILD@.@PATCH@</version>
<packaging>aar</packaging>
<name>Cronet</name>
<description>High performance implementation of Cronet using native libraries.</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cronet-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.chromium.net</groupId>
<artifactId>cronet-fallback</artifactId>
<version>@MAJOR@.@MINOR@.@BUILD@.@PATCH@</version>
<packaging>aar</packaging>
<name>Cronet</name>
<description>Low performance fallback Cronet implementation based on Android system HttpURLConnection implementation. Should only be used as a backup when Cronet native library implementation fails to load.</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cronet-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
sdk.dir=../../../../third_party/android_tools/sdk
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
def cronet_dir = "../../../../../components/cronet/android"
buildTypes {
release {
minifyEnabled true
testProguardFiles "$cronet_dir/maven/test/proguard.cfg"
}
debug {
minifyEnabled true
testProguardFiles "$cronet_dir/maven/test/proguard.cfg"
}
}
// Cronet jars contain Java 8 bytecodes.
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
defaultConfig {
applicationId "org.chromium.cronet_sample_apk"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
sourceSets {
main {
manifest.srcFile "$cronet_dir/sample/AndroidManifest.xml"
java.srcDirs = [ "$cronet_dir/sample/src" ]
res.srcDirs = [ "$cronet_dir/sample/res" ]
}
androidTest {
manifest.srcFile "$cronet_dir/sample/javatests/AndroidManifest.xml"
java.srcDirs = [ "$cronet_dir/sample/javatests/src" ]
}
}
}
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
url '../..'
}
}
dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'org.chromium.net:cronet-embedded:@MAJOR@.@MINOR@.@BUILD@.@PATCH@'
androidTestUtil 'com.android.support.test:orchestrator:1.0.1'
}
#!/usr/bin/env python
#
# Copyright 2018 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.
import optparse
import os
import sys
REPOSITORY_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..', '..', '..'))
sys.path.append(os.path.join(REPOSITORY_ROOT, 'build', 'android', 'gyp',
'util'))
import build_utils
def BuildWithGradle(options):
gradle_path = os.path.join(REPOSITORY_ROOT, 'third_party', 'gradle_wrapper',
'gradlew')
gradle_cmd = [gradle_path, 'assembleDebug', 'assembleAndroidTest']
build_utils.CheckOutput(gradle_cmd, cwd=options.project_dir)
def main():
parser = optparse.OptionParser()
build_utils.AddDepfileOption(parser)
parser.add_option('--project-dir', help='Gradle project directory.')
parser.add_option('--stamp', help='Path to touch on success.')
options, _ = parser.parse_args()
BuildWithGradle(options)
if options.depfile:
assert options.stamp
build_utils.WriteDepfile(options.depfile, options.stamp)
if options.stamp:
build_utils.Touch(options.stamp)
if __name__ == '__main__':
sys.exit(main())
# This is needed to avoid proguard warnings like:
# library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
-dontwarn org.xmlpull.v1.*
# This is needed to avoid proguard warnings like:
# com.google.devtools.build.android.desugar.runtime.ThrowableExtension is not being kept as
# 'com.google.devtools.build.android.desugar.runtime.ThrowableExtension', but remapped to
# 'a.a.a.a.a.a.a.a'
-dontwarn com.google.devtools.build.android.desugar.runtime.**
......@@ -6,7 +6,6 @@
import optparse
import os
import shutil
import sys
import tempfile
......@@ -34,7 +33,8 @@ class CronetExtension(Extension):
CronetPostprocessor(md), '_end')
def GenerateJavadoc(options, src_dir, output_dir):
def GenerateJavadoc(options, src_dir):
output_dir = os.path.abspath(os.path.join(options.output_dir, 'javadoc'))
working_dir = os.path.join(options.input_dir, 'android', 'api')
overview_file = os.path.abspath(options.overview_file)
......@@ -72,14 +72,6 @@ def GenerateJavadoc(options, src_dir, output_dir):
build_utils.DeleteDirectory(output_dir)
raise
# Create an index.html file at the root as this is the accepted format.
# Do this by copying reference/index.html and adjusting the path.
with open(os.path.join(output_dir, 'reference', 'index.html'), 'r') as \
old_index, open(os.path.join(output_dir, 'index.html'), 'w') as new_index:
for line in old_index:
new_index.write(line.replace('classes.html',
os.path.join('reference', 'classes.html')))
def main():
parser = optparse.OptionParser()
......@@ -89,7 +81,7 @@ def main():
parser.add_option('--input-src-jar', help='Cronet api source jar')
parser.add_option('--overview-file', help='Path of the overview page')
parser.add_option('--readme-file', help='Path of the README.md')
parser.add_option('--zip-file', help='Path to ZIP archive of javadocs.')
parser.add_option('--stamp', help='Path to touch on success.')
parser.add_option('--android-sdk-jar', help='Path to android.jar')
options, _ = parser.parse_args()
......@@ -104,18 +96,16 @@ def main():
net_docs.ProcessDocs([options.readme_file], options.input_dir,
options.output_dir, extensions=[CronetExtension()])
output_dir = os.path.abspath(os.path.join(options.output_dir, 'javadoc'))
GenerateJavadoc(options, os.path.abspath(unzipped_jar_path), output_dir)
GenerateJavadoc(options, os.path.abspath(unzipped_jar_path))
if options.zip_file:
assert options.zip_file.endswith('.zip')
shutil.make_archive(options.zip_file[:-4], 'zip', output_dir)
if options.stamp:
build_utils.Touch(options.stamp)
if options.depfile:
assert options.zip_file
assert options.stamp
deps = []
for root, _, filenames in os.walk(options.input_dir):
deps.extend(os.path.join(root, f) for f in filenames)
build_utils.WriteDepfile(options.depfile, options.zip_file, deps)
build_utils.WriteDepfile(options.depfile, options.stamp, deps)
# Clean up temporary output directory.
build_utils.DeleteDirectory(unzipped_jar_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment