aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools
Commit message (Collapse)AuthorAge
* Minor backwards compatibility fixes:Gravatar Googler2016-07-21
| | | | | | | | * Account for the dataKey in MergeConflicts (whoops.) * When finding a conflict, always take the last value -- this matches the current merger strategy. -- MOS_MIGRATED_REVID=127980673
* Add target names for mergee manifests to generate more helpful error ↵Gravatar Andrew Pellegrini2016-07-20
| | | | | | | messages from manifest merging when using manifest_merger="android" on android_binary rules. -- MOS_MIGRATED_REVID=127962630
* Command line options processing.Gravatar Sasha Smundak2016-07-20
| | | | | -- MOS_MIGRATED_REVID=127924233
* Plumb customPackage to RClassGenerator and skip empty R classesGravatar Googler2016-07-20
| | | | | | | | | | | | | Forgot to do this, so we get compiler errors since it can't find the R class imported under the requested custom java package. Also, avoid writing out the top-level R.class file if there are no symbols. There is a test that happens to check for this. -- MOS_MIGRATED_REVID=127888913
* Add transient_bytes.h and test for it.Gravatar Sasha Smundak2016-07-20
| | | | | -- MOS_MIGRATED_REVID=127863019
* Command file tokenizer. Mimics the behavior of theGravatar Sasha Smundak2016-07-19
| | | | | | | com.google.devtools.build.lib.shell.ShellUtils class. -- MOS_MIGRATED_REVID=127846401
* Removes "-preview" hack for Android build tools version attribute.Gravatar Googler2016-07-19
| | | | | | | This has been a no-op since commit 9a21e20ab55dad018caee765d67be528fa84caf0. -- MOS_MIGRATED_REVID=127771957
* Refactor test utilities.Gravatar Sasha Smundak2016-07-18
| | | | | -- MOS_MIGRATED_REVID=127569037
* C++ reimplementation of singlejar tool: first checkin, take two: fix the ↵Gravatar Sasha Smundak2016-07-18
| | | | | | | | | | | | | | | | | | | problem that caused the rollback. *** Original change description *** Automated [] rollback of commit f667aa54f4fcc2c04182de9bc267a7ee469f6445. *** Reason for rollback *** Breaks CI, see, e.g., http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=ubuntu_15.10-x86_64/92/console *** Original change description *** C++ reimplementation of singlejar tool: first checkin. -- MOS_MIGRATED_REVID=127554239
* Record and propagate namespaces from the <resources> element correctly.Gravatar Googler2016-07-15
| | | | | | | | | | | * Reduces the size of merged values.xml * Improves correctness of merged xml Sadly, this is also backwards compatible by allowing multiple definitions of a prefix with different namespaces. Will be cleaned up after transition. -- MOS_MIGRATED_REVID=127481147
* Remove anydpi support to improve backwards compatibility.Gravatar Googler2016-07-15
| | | | | -- MOS_MIGRATED_REVID=127466889
* Rollback of commit 80d1e16b7ae1d04fa2fa4c561588fe9fdbaefc41.Gravatar Carmi Grushko2016-07-14
| | | | | | | | | | | | | *** Reason for rollback *** Breaks Bazel's CI because the current release (0.3.0) is used to query some targets, which doesn't have java_proto_library yet. *** Original change description *** Use the native java_proto_library instead of the macro defined in genproto.bzl. -- MOS_MIGRATED_REVID=127431334
* Use the native java_proto_library instead of the macro defined in genproto.bzl.Gravatar Carmi Grushko2016-07-14
| | | | | -- MOS_MIGRATED_REVID=127324151
* * Standardize attribute storage in the protoGravatar Googler2016-07-12
| | | | | | | * Add attributes to PluralXmlResourceValue -- MOS_MIGRATED_REVID=127147486
* Centralize the creation of the XmlInputFactoryGravatar Googler2016-07-12
| | | | | | | | Properly handle unary tags in AttrXmlResourceValue Handle CData for string content. -- MOS_MIGRATED_REVID=127118005
* Fix android manifest merger from using only one mergee manifest.Gravatar Andrew Pellegrini2016-07-11
| | | | | | | Mergee manifests are pre-processed and written to a temp directory, based on their original path, before the final merge. Previously only the filename was used, resulting in each mergee overwriting the previous, all of which were <temp_dir>/AndroidManifest.xml. Using the full path of each manifest ensures this overwriting cannot occur. -- MOS_MIGRATED_REVID=126942789
* Enhance AndroidResourceProcessingAction's split detection.Gravatar Michael Staib2016-07-08
| | | | | | | | | | | | | | The --splits flag is now --split, since I remembered about how allowMultiple exists. More importantly, split APKs are now correctly moved to filenames which are fairly trivially constructed from the input split flags, allowing Bazel to just do a simple one-character replace on the split flags and know what files the resource processing action is going to output. One more step in the quest for world domination, or rather, split APKs for resources. Next: Actually supporting this in android_binary. -- MOS_MIGRATED_REVID=126838431
* More pieces of RClassGeneratorActionGravatar Googler2016-07-08
| | | | | | | | | | | | Add the rclass_generator.sh, and fill in the boiler-plate for mock tools, etc. Mostly cargo- culting references to resources_processor.sh. Rename earlier pieces to use RClassGenerator prefix instead of AndroidResourceCompilation. -- MOS_MIGRATED_REVID=126831848
* Split and extract the SHA1 from Maven files that have extra paths in themGravatar Paul Gross2016-07-07
| | | | | | | | | | This fixes #1461, which leads to bad sha1 values for some maven jars. Closes #1473. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/1473 MOS_MIGRATED_REVID=126785326
* Remove .9 from nine-patch FullyQualifiedNamesGravatar Googler2016-07-07
| | | | | | | | | | | | | | | | In the end, foo.9.png should result in an R.java field R.drawable.foo (not R.drawable.foo_9). Also, given foo.9.png and foo.png, aapt will give an error: res/drawable/foo.png:0: error: Resource entry foo is already defined. res/drawable/foo.9.png:0: Originally defined here. So it seems like we should generate a merge conflict warning as well. Adjust FQN accordingly. -- MOS_MIGRATED_REVID=126693820
* Fixed IdlClassTest on WindowsGravatar Yun Peng2016-07-06
| | | | | | | | | The test was failing because IdlClass can't handle file path with back-slash -- Change-Id: Ica72da756fd4bd9b4f8d907ff795549a59edc8be Reviewed-on: https://bazel-review.googlesource.com/#/c/3966 MOS_MIGRATED_REVID=126636692
* Rollback of commit f667aa54f4fcc2c04182de9bc267a7ee469f6445.Gravatar Klaus Aehlig2016-07-04
| | | | | | | | | | | | | *** Reason for rollback *** Breaks CI, see, e.g., http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=ubuntu_15.10-x86_64/92/console *** Original change description *** C++ reimplementation of singlejar tool: first checkin. -- MOS_MIGRATED_REVID=126565472
* Add output log for android resource shrinking, following the format produced ↵Gravatar Andrew Pellegrini2016-07-04
| | | | | | | by the Gradle resource shrinker in resources.txt. -- MOS_MIGRATED_REVID=126420534
* Parse layout/menu/drawable, etc XML files for R.idGravatar Googler2016-07-04
| | | | | | | | | | | | | | | | | To be used by a later CL where we use this more complete picture of all the resource items to generate our own R.java/class without invoking AAPT (and split out AAPT to a separate action that is off the java builder critical path). Technically aapt creates R.id.foo for attr <enum name="foo" ... /> and flag as well, but I haven't seen code that actually relies on that. Currently off-by-default (only exercised by tests). -- MOS_MIGRATED_REVID=126407838
* Add all the sources to //:srcs filegroup and add a check to detectGravatar Damien Martin-Guillerez2016-07-01
| | | | | | | | | | | missing file to it. We need to activate this check on presubmits -- Change-Id: Ia95e92d3816ce92bb69bc0e2cf56e9c60b68d970 Reviewed-on: https://bazel-review.googlesource.com/#/c/3949/ MOS_MIGRATED_REVID=126404792
* C++ reimplementation of singlejar tool: first checkin.Gravatar Sasha Smundak2016-07-01
| | | | | -- MOS_MIGRATED_REVID=126354275
* * Clean up of the old Iterable<String> method of writing xmlGravatar Googler2016-07-01
| | | | | | | * Add in some line breaks for easier to read output. -- MOS_MIGRATED_REVID=126315204
* Fixes the case where an optional attribute needs to be an empty string. This ↵Gravatar Googler2016-07-01
| | | | | | | | | is necessary for <style parent="">. The previous code omitted empty strings to avoid the <attr format=""> case which is an error for aapt. -- MOS_MIGRATED_REVID=126305040
* Switches XmlResourceValue writing to the "define" api.Gravatar Googler2016-06-30
| | | | | -- MOS_MIGRATED_REVID=126200568
* Creates a fluent api that moves the xml generation into the data writer.Gravatar Googler2016-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new "define" method replaces the now deprecated writeToValuesXml method. This provides three benefits: * An agnostic writing interface to the XmlResourceValue classes, easing the replacement of them with a proper xml writer. * A delayed write which allows the StyleableXmlResourceValue to claim AttrXmlResourceValue definitions before writing. * Centralized method of source attribution, enabling a less verbose way to indicate multiple values came from a single xml source file. An example of the new interface writing the StyleXmlResourceValue: ValuesResourceDefinition definition = mergedDataWriter .define(key) .derivedFrom(source) .startTag("style") .named(key) .optional() .attribute("parent") .setTo(parent) .closeTag(); for (Entry<String, String> entry : values.entrySet()) { definition = definition .startItemTag() .named(entry.getKey()) .close() .addCharactersOf(entry.getValue()) .endTag(); } definition.endTag().save(); -- MOS_MIGRATED_REVID=126196028
* Record whether the attr is defined or referenced in the styleable. Despite ↵Gravatar Googler2016-06-29
| | | | | | | the functional equality, the definition type of the attribute has direct impact on the order in which the attribute appears in the styleable array. -- MOS_MIGRATED_REVID=126126122
* Fixed four more Bazel java tests on Windows causing by back-slash in file pathGravatar Yun Peng2016-06-29
| | | | | | | | | | | | | | Newly passing: //src/test/java/com/google/devtools/build/... android/ideinfo:PackageParserTest android/ideinfo:ArtifactLocationConverterTest android:AndroidResourceCompilationActionTest lib:ideinfo_test -- Change-Id: If035533f3c238489d9791bac9ca49143b84b06df Reviewed-on: https://bazel-review.googlesource.com/#/c/3913 MOS_MIGRATED_REVID=126072874
* Stop sanitizing the style parent attribute.Gravatar Googler2016-06-28
| | | | | | | RELNOTES:None -- MOS_MIGRATED_REVID=125989427
* Speed up resetting file/directory dates to zip epoch by 100x. Gravatar Googler2016-06-27
| | | | | | | | | | | | | It is better to use the {} + as it passes the file list to touch instead of calling touch command once for each file. This will reduce the number of times touch process is created and massively speed up the script From man page -exec utility [argument ...] {} + Same as -exec, except that ``{}'' is replaced with as many pathnames as possible for each invocation of utility. This behaviour is similar to that of xargs(1). -- MOS_MIGRATED_REVID=125821677
* "xcode_locator -v" dedupes multiple copies of the same xcode version ↵Gravatar Chris Parsons2016-06-24
| | | | | | | | | installed on the host, and appends DEVELOPER_DIR to the specification on each line. This should be the last of what is needed from this option, in order to launch local generated xcode_config and xcode_version targets in skylark. -- MOS_MIGRATED_REVID=125725500
* Rollback of commit 0de6a93fcc4fd6304936165b07963c4d722c44be.Gravatar Philipp Wollermann2016-06-23
| | | | | | | | | | | *** Reason for rollback *** This breaks the Bazel build because "putMappedXmlValue" does not exist. See: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=linux-x86_64/616/console -- MOS_MIGRATED_REVID=125671091
* Change the BufferedReader to BufferedInputStream, as the UTF-8 bom crashes ↵Gravatar Googler2016-06-23
| | | | | | | | | the BufferedReader. Add the errors a suppressed exceptions which is more useful for debugging. -- MOS_MIGRATED_REVID=125609925
* Adds the Android manifest merger as an option for android_binary rules. The ↵Gravatar Andrew Pellegrini2016-06-23
| | | | | | | | | merger that is used (legacy or android) is controlled by the manifest_merger attribute on android_binary and the default is controlled by the --android_manifest_merger flag. RELNOTES: The Android manifest merger is now available as an option for android_binary rules. The merger will honor tools annotations in AndroidManifest.xml and will perform placeholder substitutions using the values specified in android_binary.manifest_values. The merger may be selected by setting the manifest_merger attribute on android_binary. -- MOS_MIGRATED_REVID=125603954
* Get rid of a bunch of IOExceptions that were being unnecessarily thrown. We ↵Gravatar Janak Ramakrishnan2016-06-23
| | | | | | | don't want to throw IOExceptions unless there is an actual IOException. Syntax errors in WORKSPACE files don't qualify, and neither do badly written Skylark rules. I may have misunderstood some code here, so please do push back if the root causes here really can be filesystem issues. -- MOS_MIGRATED_REVID=125591177
* Global cleanup change.Gravatar Googler2016-06-23
| | | | | -- MOS_MIGRATED_REVID=125574484
* Roll forward of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214: action to ↵Gravatar Googler2016-06-23
| | | | | | | | | | | | | | | | | | | | | | | | write R classes directly NEW: add check that primary R.txt exists before trying to load its symbols. Rollback of commit 32c6c15c8b9bc4e203529f60bedbc5cd8a496a36. *** Reason for rollback *** Rollforward with check that primary R.txt exists *** Original change description *** Automated [] rollback of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214. *** Reason for rollback *** Doesn't handle aapt that doesn't generate R.txt properly. -- MOS_MIGRATED_REVID=125559472
* Rollback of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214.Gravatar Googler2016-06-21
| | | | | | | | | *** Reason for rollback *** Doesn't handle aapt that doesn't generate R.txt properly. -- MOS_MIGRATED_REVID=125405481
* Add action to write android_binary and lib R.classes directlyGravatar Googler2016-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For android_binary rules, we regenerate all of the R.java of the libraries to get the final resource IDs. Compiling all of them together can be slow with the normal JavaBuilder, so add a specialized class writer. Example build with many R.java classes: - R.java -> R.class via JavaBuilder: over 80s - ErrorProne takes about 40% of that. So turning off ErrorProne would be projected to be 48s. Some of ErrorProne slowness is from static field checks (e.g., on Flag classes), which may look up the same Type over and over. In comparison, if we write our own bytecode with ASM: - ~16s total - 4.7s to parse R.txt - 4.8s to write class files - 5.8s to copy and compress .jar TODO: clean up SymbolLoader patching (upstream) This only creates the action. We will need to separately wire this up in blaze. NOTE: This also makes the exising R.txt loading used by live code multi-threaded, since that is partly I/O-bound. Something to watch out for (for flakiness, etc.) once this is submitted. -- MOS_MIGRATED_REVID=125384467
* Move libtool-wrapper symlinking logic from xcrunwrapper to libtool script.Gravatar Chris Parsons2016-06-15
| | | | | -- MOS_MIGRATED_REVID=124831722
* Rollback of commit 5160d196e62bf6f8fa56b32746a01b182729c5c8.Gravatar Googler2016-06-14
| | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with fixed proto call to getMappedStringValue. *** Original change description *** Automated [] rollback of commit 4f854d47888d011354357e965fd3c7bf1d74b95f. *** Reason for rollback *** Breakage: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/601/ *** Original change description *** Xml processing fixes: * Support for <item name="foo" type="id">7x0000</item> * Adds <eat-comment/> after source attributions to ensure they are not sent to the final binary * Store attributes for arrays to the string translatable=false case -- MOS_MIGRATED_REVID=124748547
* Rollback of commit 4f854d47888d011354357e965fd3c7bf1d74b95f.Gravatar Yue Gan2016-06-13
| | | | | | | | | | | | | | | | *** Reason for rollback *** Breakage: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/601/ *** Original change description *** Xml processing fixes: * Support for <item name="foo" type="id">7x0000</item> * Adds <eat-comment/> after source attributions to ensure they are not sent to the final binary * Store attributes for arrays to the string translatable=false case -- MOS_MIGRATED_REVID=124708349
* Xml processing fixes:Gravatar Googler2016-06-13
| | | | | | | | | * Support for <item name="foo" type="id">7x0000</item> * Adds <eat-comment/> after source attributions to ensure they are not sent to the final binary * Store attributes for arrays to the string translatable=false case -- MOS_MIGRATED_REVID=124684322
* xcode_locator supports -v mode, which outputs only system-supported xcode ↵Gravatar Chris Parsons2016-06-09
| | | | | | | | | versions and their aliases in easily-parsed format This is convenient as skylark does not have extensive string-parsing (regex) features, and when xcode-locator is invoked from a skylark rule, this format is cleanest and contains only relevant info. -- MOS_MIGRATED_REVID=124372740
* Rollback of commit 6eea9bd27fc88129ccb2d74c1b550e83ebf39f17.Gravatar Googler2016-06-07
| | | | | | | | | | | | | *** Reason for rollback *** Broke Mac local builds *** Original change description *** Add export ZERO_AR_DATE=1 to libtool.sh removing possible timestamp issues. -- MOS_MIGRATED_REVID=124258787
* Small fixes:Gravatar Googler2016-06-07
| | | | | | | | * Sort the FullyQualifiedNames during writing for determinism. * Crunch all pngs not in raw -- MOS_MIGRATED_REVID=124245017