diff options
author | 2016-01-29 20:14:48 +0000 | |
---|---|---|
committer | 2016-02-01 09:45:50 +0000 | |
commit | 191646d44dc8cf51391f5061fbf08a58e7706a03 (patch) | |
tree | e09c0d51eb527e6b743db2fd069aa2c660622a79 /src | |
parent | f1121951d4e9a77291956f58be1c32a1f444d2d9 (diff) |
RELNOTES[INC]: Remove JAVAC "Make" variable
The JAVAC "Make" variable is the javac packaged with the host JDK, which is not
necessarily the same version used to compile java_library rules.
Users should typically use java_library directly. If a manual javac invocation
is required, BazelJavac uses the same javac version and flags as java_library.
In the rare cases where the host JDK's compiler is actually desired, prefer
`$(JAVABASE)/bin/javac` to `$(JAVAC)` for clarity.
--
MOS_MIGRATED_REVID=113386241
Diffstat (limited to 'src')
3 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm index 684f998b8f..2f5b9075e9 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm @@ -87,9 +87,6 @@ in your genrule's cmd attribute. this can be a relative path. If you must change directories before invoking <code>java</code>, you need to capture the working directory before changing it.</li> - <li> <code>JAVAC</code>: The "javac" command (a Java compiler). Note that - this can be a relative path. Also, this may not be the same compiler that is - used to compile normal Java rules (this may change in the future).</li> <li> <code>STRIP</code>: The strip command from the same suite as the C compiler.</li> diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/Jvm.java b/src/main/java/com/google/devtools/build/lib/rules/java/Jvm.java index b4fc376aed..5888013843 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/Jvm.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/Jvm.java @@ -107,6 +107,5 @@ public final class Jvm extends BuildConfiguration.Fragment { public void addGlobalMakeVariables(Builder<String, String> globalMakeEnvBuilder) { globalMakeEnvBuilder.put("JAVABASE", getJavaHome().getPathString()); globalMakeEnvBuilder.put("JAVA", getJavaExecutable().getPathString()); - globalMakeEnvBuilder.put("JAVAC", getJavacExecutable().getPathString()); } } diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java index 709557ab8f..e83651cff0 100644 --- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java +++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java @@ -831,10 +831,10 @@ public class SkylarkRuleImplementationFunctionsTest extends SkylarkTestCase { @Test public void testDefinedMakeVariable() throws Exception { SkylarkRuleContext ctx = createRuleContext("//foo:baz"); - String javac = (String) evalRuleContextCode(ctx, "ruleContext.var['JAVAC']"); + String java = (String) evalRuleContextCode(ctx, "ruleContext.var['JAVA']"); // Get the last path segment - javac = javac.substring(javac.lastIndexOf('/')); - assertEquals("/javac", javac); + java = java.substring(java.lastIndexOf('/')); + assertEquals("/java", java); } @Test |