Update to Prolog Cafe 1.4
Prolog Cafe is now built with Buck and has a slightly smaller runtime. Many features not required for Gerrit Code Review were stripped out of the fork. Package names were reorganized to make the runtime smaller to read by pulling exceptions out to their own package. This is a breaking change for any plugins that contribute a predicate. Change-Id: Icb50d306dfda146497814c65e2c03fae416ec5e1
This commit is contained in:
parent
cc2b3b5f63
commit
cc34990493
gerrit-pgm
gerrit-server
BUCK
src
main/java
com/google/gerrit
rules
server
gerrit
AbstractCommitUserIdentityPredicate.javaPRED__load_commit_labels_1.javaPRED__user_label_range_4.javaPRED_change_branch_1.javaPRED_change_owner_1.javaPRED_change_project_1.javaPRED_change_topic_1.javaPRED_commit_author_3.javaPRED_commit_committer_3.javaPRED_commit_delta_4.javaPRED_commit_edits_2.javaPRED_commit_message_1.javaPRED_commit_stats_3.javaPRED_current_user_1.javaPRED_current_user_2.javaPRED_get_legacy_label_types_1.javaPRED_project_default_submit_type_1.java
test/java/com/google/gerrit/rules
lib/prolog
@ -91,7 +91,7 @@ java_library(
|
||||
|
||||
java_library(
|
||||
name = 'pgm',
|
||||
srcs = glob([SRCS + '*.java']),
|
||||
srcs = glob([SRCS + '*.java', SRCS + 'rules/*.java']),
|
||||
resources = glob([RSRCS + '*']),
|
||||
deps = DEPS + [
|
||||
':http',
|
||||
@ -105,7 +105,9 @@ java_library(
|
||||
'//lib:args4j',
|
||||
'//lib:gwtorm',
|
||||
'//lib:servlet-api-3_1',
|
||||
'//lib/prolog:prolog-cafe',
|
||||
'//lib/prolog:cafeteria',
|
||||
'//lib/prolog:compiler',
|
||||
'//lib/prolog:runtime',
|
||||
],
|
||||
provided_deps = ['//gerrit-launcher:launcher'],
|
||||
visibility = [
|
||||
|
@ -16,19 +16,18 @@ package com.google.gerrit.pgm;
|
||||
|
||||
import com.google.gerrit.pgm.util.AbstractProgram;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.HaltException;
|
||||
import com.googlecode.prolog_cafe.lang.BufferingPrologControl;
|
||||
import com.googlecode.prolog_cafe.lang.HaltException;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologClassLoader;
|
||||
import com.googlecode.prolog_cafe.lang.PrologMain;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.repl.PrologMain;
|
||||
|
||||
import org.kohsuke.args4j.Option;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
public class PrologShell extends AbstractProgram {
|
||||
@ -41,14 +40,10 @@ public class PrologShell extends AbstractProgram {
|
||||
|
||||
BufferingPrologControl pcl = new BufferingPrologControl();
|
||||
pcl.setPrologClassLoader(new PrologClassLoader(getClass().getClassLoader()));
|
||||
pcl.setEnabled(EnumSet.allOf(Prolog.Feature.class), false);
|
||||
pcl.setEnabled(Prolog.Feature.IO, true);
|
||||
pcl.setEnabled(Prolog.Feature.STATISTICS_RUNTIME, true);
|
||||
|
||||
pcl.setEnabled(Prolog.Feature.STATISTICS, true);
|
||||
pcl.configureUserIO(System.in, System.out, System.err);
|
||||
pcl.initialize(Prolog.BUILTIN);
|
||||
pcl.execute(Prolog.BUILTIN, "set_prolog_flag",
|
||||
SymbolTerm.intern("print_stack_trace"),
|
||||
SymbolTerm.intern("on"));
|
||||
|
||||
for (String file : fileName) {
|
||||
String path;
|
||||
|
@ -17,15 +17,15 @@ package com.google.gerrit.pgm;
|
||||
import static com.google.gerrit.server.schema.DataSourceProvider.Context.SINGLE_USER;
|
||||
|
||||
import com.google.gerrit.lifecycle.LifecycleManager;
|
||||
import com.google.gerrit.pgm.rules.PrologCompiler;
|
||||
import com.google.gerrit.pgm.util.SiteProgram;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.rules.PrologCompiler;
|
||||
import com.google.gerrit.server.config.FactoryModule;
|
||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
import org.kohsuke.args4j.Argument;
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.rules;
|
||||
package com.google.gerrit.pgm.rules;
|
||||
|
||||
import com.google.gerrit.common.TimeUtil;
|
||||
import com.google.gerrit.common.Version;
|
||||
@ -22,8 +22,8 @@ import com.google.gerrit.server.config.SitePaths;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.compiler.Compiler;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
|
||||
import org.eclipse.jgit.errors.MissingObjectException;
|
||||
import org.eclipse.jgit.lib.Config;
|
@ -66,7 +66,7 @@ java_library(
|
||||
'//lib/ow2:ow2-asm',
|
||||
'//lib/ow2:ow2-asm-tree',
|
||||
'//lib/ow2:ow2-asm-util',
|
||||
'//lib/prolog:prolog-cafe',
|
||||
'//lib/prolog:runtime',
|
||||
],
|
||||
provided_deps = [
|
||||
'//lib:servlet-api-3_1',
|
||||
@ -134,7 +134,7 @@ java_library(
|
||||
'//gerrit-common:server',
|
||||
'//lib:junit',
|
||||
'//lib/guice:guice',
|
||||
'//lib/prolog:prolog-cafe',
|
||||
'//lib/prolog:runtime',
|
||||
],
|
||||
)
|
||||
|
||||
@ -155,7 +155,7 @@ java_test(
|
||||
'//lib:truth',
|
||||
'//lib/jgit:jgit',
|
||||
'//lib/guice:guice',
|
||||
'//lib/prolog:prolog-cafe',
|
||||
'//lib/prolog:runtime',
|
||||
],
|
||||
)
|
||||
|
||||
@ -217,7 +217,7 @@ java_test(
|
||||
'//lib/joda:joda-time',
|
||||
'//lib:parboiled-core',
|
||||
'//lib:parboiled-java',
|
||||
'//lib/prolog:prolog-cafe',
|
||||
'//lib/prolog:runtime',
|
||||
],
|
||||
source_under_test = [':server'],
|
||||
visibility = ['//tools/eclipse:classpath'],
|
||||
|
@ -28,6 +28,7 @@ import com.google.inject.assistedinject.Assisted;
|
||||
|
||||
import com.googlecode.prolog_cafe.lang.BufferingPrologControl;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.PredicateEncoder;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologMachineCopy;
|
||||
|
||||
@ -50,11 +51,8 @@ import java.util.Map;
|
||||
* A single copy of the Prolog interpreter, for the current thread.
|
||||
*/
|
||||
public class PrologEnvironment extends BufferingPrologControl {
|
||||
|
||||
private static final Logger log =
|
||||
LoggerFactory.getLogger(PrologEnvironment.class);
|
||||
|
||||
static final int MAX_ARITY = 8;
|
||||
LoggerFactory.getLogger(PrologEnvironment.class);
|
||||
|
||||
public static interface Factory {
|
||||
/**
|
||||
@ -68,19 +66,14 @@ public class PrologEnvironment extends BufferingPrologControl {
|
||||
|
||||
private final Args args;
|
||||
private final Map<StoredValue<Object>, Object> storedValues;
|
||||
private int reductionLimit;
|
||||
private int reductionsRemaining;
|
||||
private List<Runnable> cleanup;
|
||||
|
||||
@Inject
|
||||
PrologEnvironment(Args a, @Assisted PrologMachineCopy src) {
|
||||
super(src);
|
||||
setMaxArity(MAX_ARITY);
|
||||
setEnabled(EnumSet.allOf(Prolog.Feature.class), false);
|
||||
args = a;
|
||||
storedValues = new HashMap<>();
|
||||
reductionLimit = a.reductionLimit;
|
||||
reductionsRemaining = reductionLimit;
|
||||
cleanup = new LinkedList<>();
|
||||
}
|
||||
|
||||
@ -88,26 +81,10 @@ public class PrologEnvironment extends BufferingPrologControl {
|
||||
return args;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEngineStopped() {
|
||||
if (super.isEngineStopped()) {
|
||||
return true;
|
||||
} else if (--reductionsRemaining <= 0) {
|
||||
throw new ReductionLimitException(reductionLimit);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPredicate(Predicate goal) {
|
||||
super.setPredicate(goal);
|
||||
reductionLimit = args.reductionLimit(goal);
|
||||
reductionsRemaining = reductionLimit;
|
||||
}
|
||||
|
||||
/** @return number of reductions during execution. */
|
||||
public int getReductions() {
|
||||
return reductionLimit - reductionsRemaining;
|
||||
setReductionLimit(args.reductionLimit(goal));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -177,6 +154,19 @@ public class PrologEnvironment extends BufferingPrologControl {
|
||||
|
||||
@Singleton
|
||||
public static class Args {
|
||||
private static final Class<Predicate> CONSULT_STREAM_2;
|
||||
static {
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<Predicate> c = (Class<Predicate>) Class.forName(
|
||||
PredicateEncoder.encode(Prolog.BUILTIN, "consult_stream", 2),
|
||||
false, RulesCache.class.getClassLoader());
|
||||
CONSULT_STREAM_2 = c;
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new LinkageError("cannot find predicate consult_stream", e);
|
||||
}
|
||||
}
|
||||
|
||||
private final ProjectCache projectCache;
|
||||
private final GitRepositoryManager repositoryManager;
|
||||
private final PatchListCache patchListCache;
|
||||
@ -210,8 +200,7 @@ public class PrologEnvironment extends BufferingPrologControl {
|
||||
}
|
||||
|
||||
private int reductionLimit(Predicate goal) {
|
||||
if ("com.googlecode.prolog_cafe.builtin.PRED_consult_stream_2"
|
||||
.equals(goal.getClass().getName())) {
|
||||
if (goal.getClass() == CONSULT_STREAM_2) {
|
||||
return compileLimit;
|
||||
}
|
||||
return reductionLimit;
|
||||
|
@ -1,24 +0,0 @@
|
||||
// Copyright (C) 2014 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.rules;
|
||||
|
||||
/** Thrown by {@link PrologEnvironment} if a script runs too long. */
|
||||
public class ReductionLimitException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
ReductionLimitException(int limit) {
|
||||
super(String.format("exceeded reduction limit of %d", limit));
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ import com.google.gerrit.server.git.GitRepositoryManager;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
import com.googlecode.prolog_cafe.lang.BufferingPrologControl;
|
||||
import com.googlecode.prolog_cafe.lang.JavaObjectTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
@ -238,7 +238,6 @@ public class RulesCache {
|
||||
|
||||
private BufferingPrologControl newEmptyMachine(ClassLoader cl) {
|
||||
BufferingPrologControl ctl = new BufferingPrologControl();
|
||||
ctl.setMaxArity(PrologEnvironment.MAX_ARITY);
|
||||
ctl.setMaxDatabaseSize(DB_MAX);
|
||||
ctl.setPrologClassLoader(new PrologClassLoader(new PredicateClassLoader(
|
||||
predicateProviders, cl)));
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
package com.google.gerrit.rules;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.SystemException;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.SystemException;
|
||||
|
||||
/**
|
||||
* Defines a value cached in a {@link PrologEnvironment}.
|
||||
|
@ -38,8 +38,8 @@ import com.google.gerrit.server.project.ChangeControl;
|
||||
import com.google.gerrit.server.query.change.ChangeData;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.SystemException;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.SystemException;
|
||||
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
|
@ -106,7 +106,7 @@ public class TestSubmitRule implements RestModifyView<RevisionResource, Input> {
|
||||
Map<String, None> need;
|
||||
Map<String, AccountInfo> may;
|
||||
Map<String, None> impossible;
|
||||
Integer prologReductionCount;
|
||||
Long prologReductionCount;
|
||||
|
||||
Record(SubmitRecord r, AccountLoader accounts) {
|
||||
this.status = r.status;
|
||||
|
@ -45,7 +45,7 @@ import com.google.gerrit.server.git.ProjectLevelConfig;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
import com.googlecode.prolog_cafe.lang.PrologMachineCopy;
|
||||
|
||||
import org.eclipse.jgit.errors.ConfigInvalidException;
|
||||
|
@ -27,13 +27,13 @@ import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.reviewdb.client.PatchSet;
|
||||
import com.google.gerrit.rules.PrologEnvironment;
|
||||
import com.google.gerrit.rules.ReductionLimitException;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
import com.google.gerrit.server.CurrentUser;
|
||||
import com.google.gerrit.server.query.change.ChangeData;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.ReductionLimitException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.ListTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
@ -107,7 +107,7 @@ public class SubmitRuleEvaluator {
|
||||
private boolean skipFilters;
|
||||
private String rule;
|
||||
private boolean logErrors = true;
|
||||
private int reductionsConsumed;
|
||||
private long reductionsConsumed;
|
||||
|
||||
private Term submitRule;
|
||||
|
||||
@ -185,7 +185,7 @@ public class SubmitRuleEvaluator {
|
||||
}
|
||||
|
||||
/** @return Prolog reductions consumed during evaluation. */
|
||||
public int getReductionsConsumed() {
|
||||
public long getReductionsConsumed() {
|
||||
return reductionsConsumed;
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ public class SubmitRuleEvaluator {
|
||||
SubmitRecord rec = new SubmitRecord();
|
||||
out.add(rec);
|
||||
|
||||
if (!submitRecord.isStructure() || 1 != submitRecord.arity()) {
|
||||
if (!(submitRecord instanceof StructureTerm) || 1 != submitRecord.arity()) {
|
||||
return invalidResult(submitRule, submitRecord);
|
||||
}
|
||||
|
||||
@ -285,14 +285,16 @@ public class SubmitRuleEvaluator {
|
||||
//
|
||||
submitRecord = submitRecord.arg(0);
|
||||
|
||||
if (!submitRecord.isStructure()) {
|
||||
if (!(submitRecord instanceof StructureTerm)) {
|
||||
return invalidResult(submitRule, submitRecord);
|
||||
}
|
||||
|
||||
rec.labels = new ArrayList<>(submitRecord.arity());
|
||||
|
||||
for (Term state : ((StructureTerm) submitRecord).args()) {
|
||||
if (!state.isStructure() || 2 != state.arity() || !"label".equals(state.name())) {
|
||||
if (!(state instanceof StructureTerm)
|
||||
|| 2 != state.arity()
|
||||
|| !"label".equals(state.name())) {
|
||||
return invalidResult(submitRule, submitRecord);
|
||||
}
|
||||
|
||||
@ -410,7 +412,7 @@ public class SubmitRuleEvaluator {
|
||||
}
|
||||
|
||||
Term typeTerm = results.get(0);
|
||||
if (!typeTerm.isSymbol()) {
|
||||
if (!(typeTerm instanceof SymbolTerm)) {
|
||||
return typeError("Submit rule '" + getSubmitRule() + "' for change "
|
||||
+ cd.getId() + " of " + getProjectName()
|
||||
+ " did not return a symbol.");
|
||||
@ -481,9 +483,9 @@ public class SubmitRuleEvaluator {
|
||||
resultsTerm, env, filterRuleLocatorName, filterRuleWrapperName);
|
||||
}
|
||||
List<Term> r;
|
||||
if (resultsTerm.isList()) {
|
||||
if (resultsTerm instanceof ListTerm) {
|
||||
r = Lists.newArrayList();
|
||||
for (Term t = resultsTerm; t.isList();) {
|
||||
for (Term t = resultsTerm; t instanceof ListTerm;) {
|
||||
ListTerm l = (ListTerm) t;
|
||||
r.add(l.car().dereference());
|
||||
t = l.cdr().dereference();
|
||||
@ -577,7 +579,7 @@ public class SubmitRuleEvaluator {
|
||||
|
||||
private void appliedBy(SubmitRecord.Label label, Term status)
|
||||
throws UserTermExpected {
|
||||
if (status.isStructure() && status.arity() == 1) {
|
||||
if (status instanceof StructureTerm && status.arity() == 1) {
|
||||
Term who = status.arg(0);
|
||||
if (isUser(who)) {
|
||||
label.appliedBy = new Account.Id(((IntegerTerm) who.arg(0)).intValue());
|
||||
@ -588,10 +590,10 @@ public class SubmitRuleEvaluator {
|
||||
}
|
||||
|
||||
private static boolean isUser(Term who) {
|
||||
return who.isStructure()
|
||||
return who instanceof StructureTerm
|
||||
&& who.arity() == 1
|
||||
&& who.name().equals("user")
|
||||
&& who.arg(0).isInteger();
|
||||
&& who.arg(0) instanceof IntegerTerm;
|
||||
}
|
||||
|
||||
public Term getSubmitRule() {
|
||||
|
@ -17,11 +17,11 @@ package gerrit;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.UserIdentity;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
@ -9,13 +9,13 @@ import com.google.gerrit.rules.StoredValues;
|
||||
import com.google.gerrit.server.query.change.ChangeData;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.JavaException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.JavaException;
|
||||
import com.googlecode.prolog_cafe.lang.ListTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
@ -20,15 +20,17 @@ import com.google.gerrit.rules.StoredValues;
|
||||
import com.google.gerrit.server.CurrentUser;
|
||||
import com.google.gerrit.server.project.ChangeControl;
|
||||
|
||||
import com.googlecode.prolog_cafe.lang.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.exceptions.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.JavaObjectTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
import com.googlecode.prolog_cafe.lang.VariableTerm;
|
||||
|
||||
/**
|
||||
* Resolves the valid range for a label on a CurrentUser.
|
||||
@ -54,18 +56,18 @@ class PRED__user_label_range_4 extends Predicate.P4 {
|
||||
Term a3 = arg3.dereference();
|
||||
Term a4 = arg4.dereference();
|
||||
|
||||
if (a1.isVariable()) {
|
||||
if (a1 instanceof VariableTerm) {
|
||||
throw new PInstantiationException(this, 1);
|
||||
}
|
||||
if (!a1.isSymbol()) {
|
||||
if (!(a1 instanceof SymbolTerm)) {
|
||||
throw new IllegalTypeException(this, 1, "atom", a1);
|
||||
}
|
||||
String label = a1.name();
|
||||
|
||||
if (a2.isVariable()) {
|
||||
if (a2 instanceof VariableTerm) {
|
||||
throw new PInstantiationException(this, 2);
|
||||
}
|
||||
if (!a2.isJavaObject() || !a2.convertible(CurrentUser.class)) {
|
||||
if (!(a2 instanceof JavaObjectTerm) || !a2.convertible(CurrentUser.class)) {
|
||||
throw new IllegalTypeException(this, 2, "CurrentUser)", a2);
|
||||
}
|
||||
CurrentUser user = (CurrentUser) ((JavaObjectTerm) a2).object();
|
||||
|
@ -17,10 +17,10 @@ package gerrit;
|
||||
import com.google.gerrit.reviewdb.client.Branch;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
|
@ -17,11 +17,11 @@ package gerrit;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
@ -17,10 +17,10 @@ package gerrit;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
|
@ -17,10 +17,10 @@ package gerrit;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
|
@ -18,9 +18,9 @@ import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
||||
import com.google.gerrit.reviewdb.client.UserIdentity;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
public class PRED_commit_author_3 extends AbstractCommitUserIdentityPredicate {
|
||||
|
@ -18,9 +18,9 @@ import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
||||
import com.google.gerrit.reviewdb.client.UserIdentity;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
public class PRED_commit_committer_3 extends AbstractCommitUserIdentityPredicate {
|
||||
|
@ -19,15 +19,16 @@ import com.google.gerrit.rules.StoredValues;
|
||||
import com.google.gerrit.server.patch.PatchList;
|
||||
import com.google.gerrit.server.patch.PatchListEntry;
|
||||
|
||||
import com.googlecode.prolog_cafe.lang.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.exceptions.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.JavaObjectTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
import com.googlecode.prolog_cafe.lang.VariableTerm;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.regex.Pattern;
|
||||
@ -66,22 +67,22 @@ public class PRED_commit_delta_4 extends Predicate.P4 {
|
||||
engine.setB0();
|
||||
|
||||
Term a1 = arg1.dereference();
|
||||
if (a1.isVariable()) {
|
||||
if (a1 instanceof VariableTerm) {
|
||||
throw new PInstantiationException(this, 1);
|
||||
}
|
||||
if (!a1.isSymbol()) {
|
||||
if (!(a1 instanceof SymbolTerm)) {
|
||||
throw new IllegalTypeException(this, 1, "symbol", a1);
|
||||
}
|
||||
Pattern regex = Pattern.compile(a1.name());
|
||||
engine.areg1 = new JavaObjectTerm(regex);
|
||||
engine.areg2 = arg2;
|
||||
engine.areg3 = arg3;
|
||||
engine.areg4 = arg4;
|
||||
engine.r1 = new JavaObjectTerm(regex);
|
||||
engine.r2 = arg2;
|
||||
engine.r3 = arg3;
|
||||
engine.r4 = arg4;
|
||||
|
||||
PatchList pl = StoredValues.PATCH_LIST.get(engine);
|
||||
Iterator<PatchListEntry> iter = pl.getPatches().iterator();
|
||||
|
||||
engine.areg5 = new JavaObjectTerm(iter);
|
||||
engine.r5 = new JavaObjectTerm(iter);
|
||||
|
||||
return engine.jtry5(commit_delta_check, commit_delta_next);
|
||||
}
|
||||
@ -89,11 +90,11 @@ public class PRED_commit_delta_4 extends Predicate.P4 {
|
||||
private static final class PRED_commit_delta_check extends Operation {
|
||||
@Override
|
||||
public Operation exec(Prolog engine) {
|
||||
Term a1 = engine.areg1;
|
||||
Term a2 = engine.areg2;
|
||||
Term a3 = engine.areg3;
|
||||
Term a4 = engine.areg4;
|
||||
Term a5 = engine.areg5;
|
||||
Term a1 = engine.r1;
|
||||
Term a2 = engine.r2;
|
||||
Term a3 = engine.r3;
|
||||
Term a4 = engine.r4;
|
||||
Term a5 = engine.r5;
|
||||
|
||||
Pattern regex = (Pattern)((JavaObjectTerm)a1).object();
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -144,7 +145,7 @@ public class PRED_commit_delta_4 extends Predicate.P4 {
|
||||
private static final class PRED_commit_delta_empty extends Operation {
|
||||
@Override
|
||||
public Operation exec(Prolog engine) {
|
||||
Term a5 = engine.areg5;
|
||||
Term a5 = engine.r5;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Iterator<PatchListEntry> iter =
|
||||
|
@ -19,14 +19,16 @@ import com.google.gerrit.server.patch.PatchList;
|
||||
import com.google.gerrit.server.patch.PatchListEntry;
|
||||
import com.google.gerrit.server.patch.Text;
|
||||
|
||||
import com.googlecode.prolog_cafe.lang.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.lang.JavaException;
|
||||
import com.googlecode.prolog_cafe.exceptions.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.exceptions.JavaException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
import com.googlecode.prolog_cafe.lang.VariableTerm;
|
||||
|
||||
import org.eclipse.jgit.diff.Edit;
|
||||
import org.eclipse.jgit.errors.CorruptObjectException;
|
||||
@ -134,10 +136,10 @@ public class PRED_commit_edits_2 extends Predicate.P2 {
|
||||
}
|
||||
|
||||
private Pattern getRegexParameter(Term term) {
|
||||
if (term.isVariable()) {
|
||||
if (term instanceof VariableTerm) {
|
||||
throw new PInstantiationException(this, 1);
|
||||
}
|
||||
if (!term.isSymbol()) {
|
||||
if (!(term instanceof SymbolTerm)) {
|
||||
throw new IllegalTypeException(this, 1, "symbol", term);
|
||||
}
|
||||
return Pattern.compile(term.name(), Pattern.MULTILINE);
|
||||
|
@ -17,10 +17,10 @@ package gerrit;
|
||||
import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
|
@ -17,11 +17,11 @@ package gerrit;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
import com.google.gerrit.server.patch.PatchList;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
/**
|
||||
|
@ -21,12 +21,12 @@ import com.google.gerrit.server.CurrentUser;
|
||||
import com.google.gerrit.server.IdentifiedUser;
|
||||
import com.google.gerrit.server.PeerDaemonUser;
|
||||
|
||||
import com.googlecode.prolog_cafe.lang.EvaluationException;
|
||||
import com.googlecode.prolog_cafe.exceptions.EvaluationException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
@ -24,17 +24,18 @@ import com.google.gerrit.server.CurrentUser;
|
||||
import com.google.gerrit.server.IdentifiedUser;
|
||||
import com.google.inject.util.Providers;
|
||||
|
||||
import com.googlecode.prolog_cafe.lang.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.exceptions.IllegalTypeException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.JavaObjectTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.PInstantiationException;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
import com.googlecode.prolog_cafe.lang.VariableTerm;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -64,7 +65,7 @@ class PRED_current_user_2 extends Predicate.P2 {
|
||||
Term a1 = arg1.dereference();
|
||||
Term a2 = arg2.dereference();
|
||||
|
||||
if (a1.isVariable()) {
|
||||
if (a1 instanceof VariableTerm) {
|
||||
throw new PInstantiationException(this, 1);
|
||||
}
|
||||
|
||||
@ -76,7 +77,7 @@ class PRED_current_user_2 extends Predicate.P2 {
|
||||
}
|
||||
|
||||
public Term createUser(Prolog engine, Term key) {
|
||||
if (!key.isStructure()
|
||||
if (!(key instanceof StructureTerm)
|
||||
|| key.arity() != 1
|
||||
|| !((StructureTerm) key).functor().equals(user)) {
|
||||
throw new IllegalTypeException(this, 1, "user(int)", key);
|
||||
@ -84,7 +85,7 @@ class PRED_current_user_2 extends Predicate.P2 {
|
||||
|
||||
Term idTerm = key.arg(0);
|
||||
CurrentUser user;
|
||||
if (idTerm.isInteger()) {
|
||||
if (idTerm instanceof IntegerTerm) {
|
||||
Map<Account.Id, IdentifiedUser> cache = StoredValues.USERS.get(engine);
|
||||
Account.Id accountId = new Account.Id(((IntegerTerm) idTerm).intValue());
|
||||
user = cache.get(accountId);
|
||||
|
@ -18,12 +18,12 @@ import com.google.gerrit.common.data.LabelType;
|
||||
import com.google.gerrit.common.data.LabelValue;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.IntegerTerm;
|
||||
import com.googlecode.prolog_cafe.lang.ListTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
@ -18,10 +18,10 @@ import com.google.gerrit.extensions.client.SubmitType;
|
||||
import com.google.gerrit.rules.StoredValues;
|
||||
import com.google.gerrit.server.project.ChangeControl;
|
||||
|
||||
import com.googlecode.prolog_cafe.exceptions.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.Operation;
|
||||
import com.googlecode.prolog_cafe.lang.Predicate;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.PrologException;
|
||||
import com.googlecode.prolog_cafe.lang.SymbolTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Term;
|
||||
|
||||
|
@ -33,7 +33,8 @@ import com.google.gerrit.server.project.Util;
|
||||
import com.google.gerrit.testutil.InMemoryRepositoryManager;
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.ReductionLimitException;
|
||||
import com.googlecode.prolog_cafe.lang.JavaObjectTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
import com.googlecode.prolog_cafe.lang.StructureTerm;
|
||||
@ -112,7 +113,6 @@ public class GerritCommonTest extends PrologTestCase {
|
||||
public void testReductionLimit() throws CompileException {
|
||||
PrologEnvironment env = envFactory.create(machine);
|
||||
setUpEnvironment(env);
|
||||
env.setEnabled(Prolog.Feature.IO, true);
|
||||
|
||||
String script = "loopy :- b(5).\n"
|
||||
+ "b(N) :- N > 0, !, S = N - 1, b(S).\n"
|
||||
|
@ -22,7 +22,7 @@ import com.google.gerrit.common.TimeUtil;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Module;
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
import com.googlecode.prolog_cafe.lang.BufferingPrologControl;
|
||||
import com.googlecode.prolog_cafe.lang.JavaObjectTerm;
|
||||
import com.googlecode.prolog_cafe.lang.Prolog;
|
||||
@ -185,8 +185,8 @@ public abstract class PrologTestCase {
|
||||
|
||||
private Term removePackage(Term test) {
|
||||
Term name = test;
|
||||
if (name.isStructure() && ":".equals(((StructureTerm) name).name())) {
|
||||
name = ((StructureTerm) name).args()[1];
|
||||
if (name instanceof StructureTerm && ":".equals(name.name())) {
|
||||
name = name.arg(1);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
@ -1,15 +1,53 @@
|
||||
include_defs('//lib/maven.defs')
|
||||
|
||||
VERSION = '1.4'
|
||||
REPO = GERRIT
|
||||
|
||||
maven_jar(
|
||||
name = 'prolog-cafe',
|
||||
id = 'com.googlecode.prolog-cafe:PrologCafe:1.3',
|
||||
sha1 = '5e0fbf18e8c98c4113f9acc978306884a1152870',
|
||||
name = 'runtime',
|
||||
id = 'com.googlecode.prolog-cafe:prolog-runtime:' + VERSION,
|
||||
sha1 = 'a99cde464f7ff75371751493ab821edd7a225bc3',
|
||||
license = 'prologcafe',
|
||||
repository = GERRIT,
|
||||
repository = REPO,
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
name = 'compiler',
|
||||
id = 'com.googlecode.prolog-cafe:prolog-compiler:' + VERSION,
|
||||
sha1 = 'ced8f50f635486bc96fca6315cacb8b18a8ef68b',
|
||||
license = 'prologcafe',
|
||||
repository = REPO,
|
||||
deps = [
|
||||
':io',
|
||||
':runtime',
|
||||
],
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
name = 'io',
|
||||
id = 'com.googlecode.prolog-cafe:prolog-io:' + VERSION,
|
||||
sha1 = 'a4f71e4f7b80dd7a2ee5138d31f2c131ec672d15',
|
||||
license = 'prologcafe',
|
||||
repository = REPO,
|
||||
deps = [':runtime'],
|
||||
visibility = [],
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
name = 'cafeteria',
|
||||
id = 'com.googlecode.prolog-cafe:prolog-cafeteria:' + VERSION,
|
||||
sha1 = '9d71fbbc1e4cb9280c5a5d68836a904f7abfd9f9',
|
||||
license = 'prologcafe',
|
||||
repository = REPO,
|
||||
deps = [
|
||||
':io',
|
||||
':runtime',
|
||||
],
|
||||
visibility = ['//gerrit-pgm:'],
|
||||
)
|
||||
|
||||
java_binary(
|
||||
name = 'compiler',
|
||||
name = 'compiler_bin',
|
||||
main_class = 'BuckPrologCompiler',
|
||||
deps = [':compiler_lib'],
|
||||
visibility = ['PUBLIC'],
|
||||
@ -18,6 +56,9 @@ java_binary(
|
||||
java_library(
|
||||
name = 'compiler_lib',
|
||||
srcs = ['java/BuckPrologCompiler.java'],
|
||||
deps = [':prolog-cafe'],
|
||||
deps = [
|
||||
':compiler',
|
||||
':runtime',
|
||||
],
|
||||
visibility = ['//tools/eclipse:classpath'],
|
||||
)
|
||||
|
@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import com.googlecode.prolog_cafe.compiler.CompileException;
|
||||
import com.googlecode.prolog_cafe.compiler.Compiler;
|
||||
import com.googlecode.prolog_cafe.exceptions.CompileException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -19,7 +19,7 @@ def prolog_cafe_library(
|
||||
visibility = []):
|
||||
genrule(
|
||||
name = name + '__pl2j',
|
||||
cmd = '$(exe //lib/prolog:compiler)' +
|
||||
cmd = '$(exe //lib/prolog:compiler_bin)' +
|
||||
' $TMP $OUT ' +
|
||||
' '.join(srcs),
|
||||
srcs = srcs,
|
||||
@ -28,7 +28,7 @@ def prolog_cafe_library(
|
||||
java_library(
|
||||
name = name + '__lib',
|
||||
srcs = [':' + name + '__pl2j'],
|
||||
deps = ['//lib/prolog:prolog-cafe'] + deps,
|
||||
deps = ['//lib/prolog:runtime'] + deps,
|
||||
)
|
||||
genrule(
|
||||
name = name + '__ln',
|
||||
|
Loading…
x
Reference in New Issue
Block a user