Add precompiled cf_segments tool as x20 dependency
Since the golem builders do not have x20 access it will not be able to
compile CF segments. We therefore make a precompiled version and put
it as a depencency for the runners to use.
Change-Id: I55fbe9e02551fd51ef4e0145b4a4b0d3fb1c17a8
diff --git a/.gitignore b/.gitignore
index de74144..14e24ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,8 @@
third_party/benchmarks/santa-tracker.tar.gz
third_party/classlib.tar.gz
third_party/classlib
+third_party/cf_segments.tar.gz
+third_party/cf_segments
third_party/chrome.tar.gz
third_party/chrome
third_party/dart-sdk
diff --git a/build.gradle b/build.gradle
index ea80b85..f129fb5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -351,6 +351,7 @@
"benchmarks/kotlin-benches",
"chrome",
"classlib",
+ "cf_segments",
"desugar/desugar_20180308",
"framework",
"gmail/gmail_android_170604.16",
diff --git a/third_party/cf_segments.tar.gz.sha1 b/third_party/cf_segments.tar.gz.sha1
new file mode 100644
index 0000000..e4d4bec
--- /dev/null
+++ b/third_party/cf_segments.tar.gz.sha1
@@ -0,0 +1 @@
+2172e0b42550dd144958f9ead6d0310a68b43d65
\ No newline at end of file
diff --git a/tools/golem_build.py b/tools/golem_build.py
index 5448589..30d46bc 100755
--- a/tools/golem_build.py
+++ b/tools/golem_build.py
@@ -10,7 +10,7 @@
GRADLE_ARGS = ['--no-daemon']
BUILD_TARGETS = ['R8', 'D8', 'R8LibApiOnly', 'buildExampleJars', 'CompatDx',
- 'downloadAndroidCts', 'downloadDx', 'buildCfSegments']
+ 'downloadAndroidCts', 'downloadDx']
def Main():
gradle.RunGradle(GRADLE_ARGS + BUILD_TARGETS)
diff --git a/tools/test_r8cfsegments.py b/tools/test_r8cfsegments.py
index d160b03..20a0448 100755
--- a/tools/test_r8cfsegments.py
+++ b/tools/test_r8cfsegments.py
@@ -15,7 +15,10 @@
# <NAME>-AnnotationSets(CodeSize): <size>
# ...
#
-# Uses the R8CfSegments Java tool (Gradle target).
+# Uses the R8CfSegments Java tool which is downloaded as an x20 dependency.
+# To make changes to the R8CfSegments tool one can use the gradle target -
+# remember to update the x20 dependency afterwards if you want the numbers
+# tracked.
from __future__ import print_function
import argparse
diff --git a/tools/utils.py b/tools/utils.py
index 0f7aa96..0244197 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -59,7 +59,7 @@
'proguard6.0.1',
'lib',
'retrace.jar')
-CF_SEGMENTS_JAR = os.path.join(LIBS, 'cf_segments.jar')
+CF_SEGMENTS_TOOL = os.path.join(THIRD_PARTY, 'cf_segments')
PINNED_R8_JAR = os.path.join(REPO_ROOT, 'third_party/r8/r8.jar')
PINNED_PGR8_JAR = os.path.join(REPO_ROOT, 'third_party/r8/r8-pg6.0.1.jar')
@@ -385,7 +385,7 @@
def getCfSegmentSizes(cfFile):
cmd = ['java',
'-cp',
- CF_SEGMENTS_JAR,
+ CF_SEGMENTS_TOOL,
'com.android.tools.r8.cf_segments.MeasureLib',
cfFile]
PrintCmd(cmd)