aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java
Commit message (Collapse)AuthorAge
* Delete Literal.javaGravatar laurentlb2017-08-17
| | | | | RELNOTES: None. PiperOrigin-RevId: 165422514
* Use cached values for option converter types.Gravatar ccalvarin2017-08-16
| | | | | | This requires us to have OptionsData for all usage messages, since static functionality is being removed, but this should already have been the case. It was added as an optional argument when the expansion function feature was added, but there is actually no reason not to require it, as the public interface for usage text was already computing the optionsData anyway. PiperOrigin-RevId: 165386893
* Add more type safety to CustomCommandLine.Gravatar tomlu2017-08-16
| | | | | | | | | | | | Allowing add(Object) is too loose and can easily lead to programmer mistakes. Because of type erasure, we can't use the same overload name for (eg.) add(NestedSet<String>) and add(NestedSet<Artifact>). The API is overhauled to use the same terms everywhere, eg. "add", "addPaths", "addExecPaths". This is similar to how it used to be a few CLs ago. The API is overhauled to make sure it's consistent for all types. While tedious, the facade methods immediately dispatch to internal helpers, so implementation wise it's not too heavy. While large, this CL is almost entirely an automated refactor. PiperOrigin-RevId: 165358287
* Delete unused ObjcProvider keys.Gravatar schmitt2017-08-16
| | | | | RELNOTES: Removing a few unused objc_provider keys. PiperOrigin-RevId: 165230824
* Add @CompileTimeConstant annotations to CustomCommandLine.Gravatar tomlu2017-08-16
| | | | | | | | | This enforces certain memory-efficient patterns. For deliberate use of dynamic strings, explicitly named overloads are introduced, with javadoc that guides the programmer into making the right choice. This CL is a memory no-op on benchmarks, but it tries to prevent backslide by making sure programmers make conscious choices when they construct their command lines. RELNOTES: None PiperOrigin-RevId: 165185997
* Make CcToolchainProvider subclass ToolchainInfo. This is required for use ↵Gravatar cpeyser2017-08-16
| | | | | | of CcToolchainProvider as a "toolchain" in platform-based toolchain resolution. PiperOrigin-RevId: 165185303
* Fix Skylark parsing of call expressions.Gravatar fzaiser2017-08-14
| | | | | | | | This allows more complex expressions to be called, not just identifiers. For example, "x[0]()" is not a syntax error anymore. RELNOTES: None PiperOrigin-RevId: 165157981
* Introduce a new SpawnCache API; add a RemoteSpawnCache implementationGravatar ulfjack2017-08-14
| | | | | | | | | | AbstractSpawnRunner now uses a SpawnCache if one is registered, this allows adding caching to any spawn runner without having to be aware of the implementations. I will delete the old CachedLocalSpawnRunner in a follow-up CL. PiperOrigin-RevId: 165024382
* Workaround for ld bug that causes flakiness when using -bitcode_symbol_map.Gravatar allevato2017-08-14
| | | | | RELNOTES: PiperOrigin-RevId: 165012363
* Validate and Link libraries action for aapt2Gravatar corysmith2017-08-14
| | | | | RELNOTES: None PiperOrigin-RevId: 165012084
* Rollback of ↵Gravatar ajmichael2017-08-14
| | | | | | | | | https://github.com/bazelbuild/bazel/commit/21436e062a12b64c8bee665b0cf79dfe48cff114. That change broke module maps that depended on the transitive headers from ObjC protos. RELNOTES: None PiperOrigin-RevId: 165010275
* Refactor FuncallExpression to allow for complex function terms later.Gravatar fzaiser2017-08-14
| | | | | RELNOTES: None. PiperOrigin-RevId: 164981071
* Remove unused tree artifact methods from CustomCommandLine.Gravatar tomlu2017-08-14
| | | | | | These only had usages in test code. The tests could be altered to use other methods. PiperOrigin-RevId: 164977900
* remote: Provide a clear error message if the remote cache is in an invalid ↵Gravatar buchgr2017-08-14
| | | | | | | | | | | | | state. A remote cache must never serve a failed action. However, if it did Bazel would not detect this and simply fail and display an error message that's hard to distinquish from a local execution failure. Bazel now displays a clear error message stating what went wrong. RELNOTES: None. PiperOrigin-RevId: 164975631
* Refactor persistent workers to use SpawnRunner.Gravatar Benjamin Peterson2017-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | Change the persistent worker spawn strategy to extend AbstractSpawnStrategy and put the actual logic into WorkerSpawnRunner. WorkerTestStrategy is unaffected. I had to extend SpawnPolicy with a speculating() method. Persistent workers need to know if speculation is happening in order to require sandboxing. Additionally, I added java_test rules for the local runner tests and worker tests. See https://github.com/bazelbuild/bazel/issues/3481. NOTE: ulfjack@ made some changes to this change before merging: - changed Reporter to EventHandler; added TODO about its usage - reverted non-semantic indentation change in AbstractSpawnStrategy - reverted a non-semantic indentation change in WorkerSpawnRunner - updated some internal classes to match - removed catch IOException in WorkerSpawnRunner in some cases, removed verboseFailures flag from WorkerSpawnRunner, updated callers - disable some tests on Windows; we were previously not running them, now that we do, they fail :-( Change-Id: I207b3938f0dc84d374ab052d5030020886451d47 PiperOrigin-RevId: 164965398
* AbstractSpawnStrategy: use ActionExecutionContext.getVerboseFailuresGravatar ulfjack2017-08-11
| | | | | | | ...instead of injecting it through the constructor. Simplify all the callers accordingly. PiperOrigin-RevId: 164955391
* multi-thread DexFileMergerGravatar kmb2017-08-11
| | | | | | RELNOTES: speedup of incremental dexing tools PiperOrigin-RevId: 164926895
* Pass List<ConfigurationFragmentFactory> to SkyframeExecutor instead of ↵Gravatar gregce2017-08-11
| | | | | | | | | | ConfigurationFactory. This is a prerequisite to removing ConfigurationFactory (which is only used for static configurations). We still need List<ConfigurationFragmentFactory> to supply ConfigurationFragmentFunction. Eventually even that will go away (for fully trimmed builds). But we're not there yet. PiperOrigin-RevId: 164890139
* Adds aapt2.ResourceCompiler and CompileLibraryResourcesAction.Gravatar corysmith2017-08-11
| | | | | | | | | | Refactorings: * Change data binding to have configurable archive generation * Extract a ZipBuilder class from the ZipBuilderVisitor to provide a general purpose archiving class. * Small changes to visibility AaptCommandLineBuilder for reuse in the aapt2 code. RELNOTES: None PiperOrigin-RevId: 164880571
* Make the print function output debug messagesGravatar vladmos2017-08-11
| | | | | RELNOTES: The `print` function now prints debug messages instead of warnings. PiperOrigin-RevId: 164880003
* Inline @Deprecated methods in CustomCommandLine.Gravatar tomlu2017-08-11
| | | | | | | | | Apart from updating CustomCommandLineTest this CL is entirely automated. We also sneak in a rename of addFormat -> addFormatted. RELNOTES: None PiperOrigin-RevId: 164870140
* Move core test classes to lib.analysis.testGravatar ulfjack2017-08-11
| | | | | | | | These are depended upon by analysis code, so need to live in the same library as lib.analysis. Moving them here makes it possible to split the build-base library into separate libraries for analysis, execution, and rules. PiperOrigin-RevId: 164847161
* Unify input prefetchingGravatar ulfjack2017-08-10
| | | | | | | All prefetching now goes through AbstractSpawnStrategy's implementation of SpawnExecutionPolicy. Make sure the sandbox runners also do this consistently. PiperOrigin-RevId: 164836877
* Move extra action stuff to analysis.extraGravatar ulfjack2017-08-10
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164835678
* Implement timeouts on top of Java ProcessGravatar ulfjack2017-08-10
| | | | PiperOrigin-RevId: 164827022
* Automated rollback of commit 8adcf839c5c42defaa2fabedfb0208e4ce97ac95.Gravatar ajmichael2017-08-10
| | | | | | | *** Reason for rollback *** RELNOTES: None PiperOrigin-RevId: 164775289
* Remove --experimental_dynamic_configs=off.Gravatar gregce2017-08-10
| | | | | | | | | | | | This is the first in a series of changes stripping out Bazel's static configuration code. This change removes the ability to request static configurations but not the (now orphaned) logic behind them. Because that logic is all over the code base, it will be removed in layers in followup changes. PiperOrigin-RevId: 164769846
* Open source apple-package java testsGravatar cparsons2017-08-10
| | | | | RELNOTES: None. PiperOrigin-RevId: 164755768
* Defer expansion of certain proto command line string arguments.Gravatar tomlu2017-08-10
| | | | | | | Memory is saved by sharing the format string and label object instances, instead of constructing new strings for each action. RELNOTES: None PiperOrigin-RevId: 164731899
* Deprecate old ordering names for depsetsGravatar vladmos2017-08-10
| | | | | | | | | Old ordering names ("stable", "compile", "naive_link", "link") are deprecated and won't be available if --incompatible_disallow_set_constructor=true is set. Use "default", "postorder", "preorder", and "topological" correspondingly instead. PiperOrigin-RevId: 164728439
* Improve CustomCommandLine.Gravatar tomlu2017-08-10
| | | | | | | | | | | | | Instead of having custom ArgvFragments for every combination of desired things, we make a combined "interpreter" of argvs. This saves memory and simplifies things as we do not have to allocate a strategy instance per call to args (instead pushing a single shared instance, followed by the args). The generic interpreter does have a lot of branching compared to the bespoke implementations, but because the branch is always the same for long stretches the branch predictor should easily be able to handle it with minimal overhead (~1 cycle per branch IIRC). This CL also elevates that we either want a NestedSet or an ImmutableCollection to the surface of the API, so consumers understand the cost when they call it with a non-immutable collection. Most of the changes in clients is due to this. To cut down on CL churn, @Deprecated forwarding methods are added to CustomCommandLine. These will be removed in a separate CL using IDE inlining. RELNOTES: None PiperOrigin-RevId: 164725370
* Rewrite the Command APIGravatar ulfjack2017-08-10
| | | | | | | | | | | | | | | | | | | | | | | | Important: the simplified API now defaults to forwarding interrupts to subprocesses. I did audit all the call sites, and I think this is a safe change to make. - Properly support timeouts with all implementations - Simplify the API - only provide two flavours of blocking calls, which require no input and forward interrupts; this is the most common usage - provide a number of async calls, which optionally takes input, and a flag whether to forward interrupts - only support input streams, no byte arrays or other 'convenience features' that are rarely needed and unnecessarily increase the surface area - use java.time.Duration to specify timeout; for consistency, interpret a timeout of <= 0 as no timeout (i.e., including rather than excluding 0) - KillableObserver and subclasses are no longer part of the public API, but still used to implement timeouts if the Subprocess.Factory does not support them - Update the documentation for Command - Update all callers; most callers now use the simplified API PiperOrigin-RevId: 164716782
* Add flag to use processed resource apk manifest fileGravatar Googler2017-08-09
| | | | | RELNOTES: none PiperOrigin-RevId: 164646858
* write dex archives uncompressedGravatar kmb2017-08-09
| | | | | | RELNOTES: none PiperOrigin-RevId: 164620306
* Move the Skylark rule infrastructure from lib.rules to lib.analysis.skylarkGravatar ulfjack2017-08-09
| | | | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. Unfortunately, there are a number of reverse deps from analysis code to Skylark classes, so moving these is the only way to make progress. PiperOrigin-RevId: 164612957
* Stop transitively propagating headers transitively for ObjC protos.Gravatar kaipi2017-08-09
| | | | PiperOrigin-RevId: 164590595
* Automated rollback of commit 963db879575132933d9254406b4c76a8f10b0ad1.Gravatar ajmichael2017-08-09
| | | | | | | *** Reason for rollback *** RELNOTES: None PiperOrigin-RevId: 164590392
* Windows, AndroidBusyBox: always use params filesGravatar laszlocsomor2017-08-09
| | | | | | | | | | | | | | | On Windows, Bazel will always use params files for some BusyBox tools, because some flags of these tools expect values with special characters in them. We need this change so Bazel can safely pass such flags to the BusyBox on Windows. See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 164582899
* Use java.time.Duration for timeoutsGravatar ulfjack2017-08-09
| | | | PiperOrigin-RevId: 164577062
* Change logic of Blaze Java coverage.Gravatar elenairina2017-08-08
| | | | | | | | | | | | | | | | | | Change is needed due to the fact that java_import or other custom rules (genrules or Skylark) do not propagate coverage information. The lack of coverage data is caused by the fact that it is retrieved from compilation information and it is passed around through providers as Artifact(s) (also known as instrumentation metadata). The problem with the current implementation is that there is no way of retrieving instrumentation metadata from arbitrary jars provided by java_import or other custom rules. The instrumentation metadata in the current implementation is a separate jar that contains uninstrumented classes for offline Jacoco instrumentation. This change addresses that problem by having just one jar instead of 2 (the build jar and the instrumentation jar), adding the uninstrumented classes in the build jar and completely removing any other instrumentation metadata. Implementation details: * For each build jar there is a .txt file created that contains the relative path of each Java file. This file will also be included in the final build jar. It is used for recreating the correct path for each covered file when included in the coverage report. * java_binary/java_test will set 2 environment variables: 1) JACOCO_METADATA_JARS - replaces the previous JACOCO_METADATA_JAR that was a jar that merged all the uninstrumented classes on the classpath in one jar. The new environment variable holds the paths of the runtime classpath jars - only some of them contain uninstrumented classes, letting the Jacoco coverage runner to filter and analyze them. 2) JACOCO_MAIN_CLASS - The main class to be called for the current coverage run. Previously this information was embedded in the JACOCO_METADATA_JAR's manifest. PiperOrigin-RevId: 164562533
* Remove special ordering of resources from PlaceholderIdFieldInitializerBuilderGravatar Googler2017-08-08
| | | | | | | | | | | | | | | | | | | | | | Before this change, PlaceholderIdFieldInitializerBuilder attempted to exactly mimic the behavior of Aapt and Gradle in assigning resource IDs. However, nothing should be relying on that specific behavior. Even if code for some reason is relying on that behavior (by, for example, doing math on a resource ID to get another resource ID), this code is currently only used to compile library resource files, which are not actually used in finished android_binary targets. This change removes the part that relies on a specific ordering of ResourceTypes; it instead just relies on the names and ordering within ResourceType. This makes things a bit simpler and also ensures new resource types added to the ResourceType enum will be picked up automatically. In particular, this change will allow us to use the new Font resource type as soon as it is released in android_ide_common. RELNOTES: none PiperOrigin-RevId: 164497262
* Improve SyntaxTreeVisitor API.Gravatar laurentlb2017-08-08
| | | | | RELNOTES: None. PiperOrigin-RevId: 164481927
* Clean up expected exception testsGravatar cushon2017-08-08
| | | | | | | | | | | | | | | | | | in preparation for a change[] Previously calls to @CheckReturnValue-annotated methods were ignored in tests that used ExpectedException. The enforcement is being changed to only ignore calls that immediately follow a call to ExpectedException#expect to improve performance. Also note that using `assertThrows` or `expectThrows` instead of `ExpectedException` is now strongly recommended: [] Tested: TAP --sample for global presubmit queue [] PiperOrigin-RevId: 164457920
* Move MakeVariableProvider to lib.analysisGravatar ulfjack2017-08-08
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164456961
* Move RuleConfiguredTargetFactory to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164446955
* Add tuple * int multiplication operatorGravatar brandjon2017-08-07
| | | | | | | I.e., ('a', 'b') * 3 == ('a', 'b', 'a', 'b', 'a', 'b'), like lists. RELNOTES: None PiperOrigin-RevId: 164403099
* Fix mutability bug in SkylarkList/SkylarkMap Java APIsGravatar brandjon2017-08-07
| | | | | | | | | Previously, you could modify a frozen MutableList indirectly via its iterator(). This CL wraps the underlying list with a Collections.unmodifiableList when obtaining the iterator, and likewise for other methods that return views over Skylark data structures. This also eliminates the SkylarkList#getContents method in favor of just using the SkylarkList object itself. RELNOTES: None PiperOrigin-RevId: 164402129
* Introduce AbstractParallelEvaluatorGravatar mschaller2017-08-07
| | | | | | | | | | This change enables alternate evaluation strategies. Drive-by fix to GraphTester, making TestFunction static because it has no dependencies on its outer class, and adding #unsetConstantValue. RELNOTES: None. PiperOrigin-RevId: 164327055
* Automated rollback of commit 496d3ded0bce12b7371a93e1183ba30e6aa88032.Gravatar buchgr2017-08-07
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll-forward. unknown commit fixed the internal protoc to also accept full paths, just as the external one does. Fixes #2265 *** Original change description *** Automated rollback of commit bcd23553f38f54fd4846aa507c827a4ee40cfab4. *** Reason for rollback *** RELNOTES: None PiperOrigin-RevId: 164324424
* Adding further error messages for cases where invalid labels are used with ↵Gravatar John Cater2017-08-07
| | | | | | | | | register_toolchains. Fixes #3429. Change-Id: Iae5632c4b866994a849032bbc2757a6a5151cc6a PiperOrigin-RevId: 164304020