forked from JetBrains/intellij-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JPS mappings for incremental compilation refactoring: support affecte…
…d files filter; add duplicate classes check GitOrigin-RevId: 3513e6903ea8e490acf6c48641f926e84fa8ba73
- Loading branch information
1 parent
3294414
commit 8f1258a
Showing
5 changed files
with
121 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 9 additions & 26 deletions
35
jps/jps-builders/src/org/jetbrains/jps/dependency/DifferentiateParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,19 @@ | ||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
package org.jetbrains.jps.dependency; | ||
|
||
public final class DifferentiateParameters { | ||
private final boolean calculateAffected; | ||
private final boolean processConstantsIncrementally; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public DifferentiateParameters() { | ||
this(true, true); | ||
} | ||
import java.util.function.Predicate; | ||
|
||
public boolean isCalculateAffected() { | ||
return calculateAffected; | ||
} | ||
public interface DifferentiateParameters { | ||
|
||
public boolean isProcessConstantsIncrementally() { | ||
return processConstantsIncrementally; | ||
} | ||
boolean isCalculateAffected(); | ||
|
||
public DifferentiateParameters(boolean calculateAffected, boolean processConstantsIncrementally) { | ||
this.calculateAffected = calculateAffected; | ||
this.processConstantsIncrementally = processConstantsIncrementally; | ||
} | ||
boolean isProcessConstantsIncrementally(); | ||
|
||
public static DifferentiateParameters byDefault() { | ||
return new DifferentiateParameters(); | ||
} | ||
@NotNull | ||
Predicate<? super NodeSource> affectionFilter(); | ||
|
||
public static DifferentiateParameters withoutAffectedCalculation() { | ||
return new DifferentiateParameters(false, true); | ||
} | ||
|
||
public static DifferentiateParameters processConstantsNonIncremental() { | ||
return new DifferentiateParameters(true, false); | ||
} | ||
@NotNull | ||
Predicate<? super NodeSource> belongsToCurrentCompilationChunk(); | ||
} |
70 changes: 70 additions & 0 deletions
70
jps/jps-builders/src/org/jetbrains/jps/dependency/impl/DifferentiateParametersBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
package org.jetbrains.jps.dependency.impl; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.jps.dependency.DifferentiateParameters; | ||
import org.jetbrains.jps.dependency.NodeSource; | ||
|
||
import java.util.function.Predicate; | ||
|
||
public final class DifferentiateParametersBuilder implements DifferentiateParameters { | ||
private boolean calculateAffected = true; | ||
private boolean processConstantsIncrementally = true; | ||
private Predicate<? super NodeSource> myAffectionFilter = s -> true; | ||
private Predicate<? super NodeSource> myCurrentChunkFilter = s -> true; | ||
|
||
private DifferentiateParametersBuilder() { | ||
} | ||
|
||
@Override | ||
public boolean isCalculateAffected() { | ||
return calculateAffected; | ||
} | ||
|
||
@Override | ||
public boolean isProcessConstantsIncrementally() { | ||
return processConstantsIncrementally; | ||
} | ||
|
||
@Override | ||
public @NotNull Predicate<? super NodeSource> affectionFilter() { | ||
return myAffectionFilter; | ||
} | ||
|
||
@Override | ||
public @NotNull Predicate<? super NodeSource> belongsToCurrentCompilationChunk() { | ||
return myCurrentChunkFilter; | ||
} | ||
|
||
public DifferentiateParameters get() { | ||
return this; | ||
} | ||
|
||
public static DifferentiateParametersBuilder create() { | ||
return new DifferentiateParametersBuilder(); | ||
} | ||
|
||
public static DifferentiateParameters withDefaultSettings() { | ||
return create().get(); | ||
} | ||
|
||
public DifferentiateParametersBuilder calculateAffected(boolean value) { | ||
calculateAffected = value; | ||
return this; | ||
} | ||
|
||
public DifferentiateParametersBuilder processConstantsIncrementally(boolean value) { | ||
processConstantsIncrementally = value; | ||
return this; | ||
} | ||
|
||
public DifferentiateParametersBuilder withAffectionFilter(Predicate<? super NodeSource> filter) { | ||
myAffectionFilter = filter; | ||
return this; | ||
} | ||
|
||
public DifferentiateParametersBuilder withChunkStructureFilter(Predicate<? super NodeSource> filter) { | ||
myCurrentChunkFilter = filter; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters