mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
external compiler: renames & cleanup
This commit is contained in:
@@ -153,7 +153,7 @@ public class BuildRunner {
|
||||
targetTypes.add(targetType);
|
||||
}
|
||||
else {
|
||||
BuildTargetLoader<?> loader = targetType.createLoader(pd.jpsModel);
|
||||
BuildTargetLoader<?> loader = targetType.createLoader(pd.getModel());
|
||||
for (String targetId : scope.getTargetIdList()) {
|
||||
BuildTarget<?> target = loader.createTarget(targetId);
|
||||
if (target != null) {
|
||||
|
||||
@@ -166,7 +166,7 @@ final class BuildSession implements Runnable, CanceledStatus {
|
||||
if (fsStateStream != null) {
|
||||
try {
|
||||
try {
|
||||
fsState.load(fsStateStream, pd.jpsModel, pd.getBuildRootIndex());
|
||||
fsState.load(fsStateStream, pd.getModel(), pd.getBuildRootIndex());
|
||||
applyFSEvent(pd, myInitialFSDelta);
|
||||
}
|
||||
finally {
|
||||
@@ -330,7 +330,7 @@ final class BuildSession implements Runnable, CanceledStatus {
|
||||
out.writeInt(FSState.VERSION);
|
||||
out.writeLong(myLastEventOrdinal);
|
||||
boolean hasWorkToDoWithModules = false;
|
||||
for (JpsModule module : pd.jpsProject.getModules()) {
|
||||
for (JpsModule module : pd.getProject().getModules()) {
|
||||
for (JavaModuleBuildTargetType type : JavaModuleBuildTargetType.ALL_TYPES) {
|
||||
if (state.hasWorkToDo(new ModuleBuildTarget(module, type))) {
|
||||
hasWorkToDoWithModules = true;
|
||||
|
||||
@@ -25,14 +25,14 @@ import java.util.Set;
|
||||
* Date: 1/8/12
|
||||
*/
|
||||
public final class ProjectDescriptor {
|
||||
public final JpsProject jpsProject;
|
||||
public final JpsModel jpsModel;
|
||||
private final JpsProject myProject;
|
||||
private final JpsModel myModel;
|
||||
public final BuildFSState fsState;
|
||||
public final ProjectTimestamps timestamps;
|
||||
public final BuildDataManager dataManager;
|
||||
private final BuildLoggingManager myLoggingManager;
|
||||
private final BuildTargetsState myTargetsState;
|
||||
public ModuleExcludeIndex moduleExcludeIndex;
|
||||
private final ModuleExcludeIndex myModuleExcludeIndex;
|
||||
private int myUseCounter = 1;
|
||||
private Set<JpsSdk<?>> myProjectJavaSdks;
|
||||
private CompilerEncodingConfiguration myEncodingConfiguration;
|
||||
@@ -40,7 +40,7 @@ public final class ProjectDescriptor {
|
||||
private final BuildTargetIndex myBuildTargetIndex;
|
||||
private final IgnoredFileIndex myIgnoredFileIndex;
|
||||
|
||||
public ProjectDescriptor(JpsModel jpsModel,
|
||||
public ProjectDescriptor(JpsModel model,
|
||||
BuildFSState fsState,
|
||||
ProjectTimestamps timestamps,
|
||||
BuildDataManager dataManager,
|
||||
@@ -48,19 +48,19 @@ public final class ProjectDescriptor {
|
||||
final ModuleExcludeIndex moduleExcludeIndex,
|
||||
final BuildTargetsState targetsState,
|
||||
final BuildTargetIndex buildTargetIndex, final BuildRootIndex buildRootIndex, IgnoredFileIndex ignoredFileIndex) {
|
||||
this.jpsModel = jpsModel;
|
||||
myModel = model;
|
||||
myIgnoredFileIndex = ignoredFileIndex;
|
||||
this.jpsProject = jpsModel.getProject();
|
||||
myProject = model.getProject();
|
||||
this.fsState = fsState;
|
||||
this.timestamps = timestamps;
|
||||
this.dataManager = dataManager;
|
||||
myBuildTargetIndex = buildTargetIndex;
|
||||
myBuildRootIndex = buildRootIndex;
|
||||
myLoggingManager = loggingManager;
|
||||
this.moduleExcludeIndex = moduleExcludeIndex;
|
||||
myModuleExcludeIndex = moduleExcludeIndex;
|
||||
myProjectJavaSdks = new HashSet<JpsSdk<?>>();
|
||||
myEncodingConfiguration = new CompilerEncodingConfiguration(jpsModel, buildRootIndex);
|
||||
for (JpsModule module : jpsProject.getModules()) {
|
||||
myEncodingConfiguration = new CompilerEncodingConfiguration(model, buildRootIndex);
|
||||
for (JpsModule module : myProject.getModules()) {
|
||||
final JpsSdk<?> sdk = module.getSdk(JpsJavaSdkType.INSTANCE);
|
||||
if (sdk != null && !myProjectJavaSdks.contains(sdk) && sdk.getVersionString() != null && sdk.getHomePath() != null) {
|
||||
myProjectJavaSdks.add(sdk);
|
||||
@@ -121,4 +121,16 @@ public final class ProjectDescriptor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ModuleExcludeIndex getModuleExcludeIndex() {
|
||||
return myModuleExcludeIndex;
|
||||
}
|
||||
|
||||
public JpsModel getModel() {
|
||||
return myModel;
|
||||
}
|
||||
|
||||
public JpsProject getProject() {
|
||||
return myProject;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
|
||||
myIsProjectRebuild = isProjectRebuild;
|
||||
myIsMake = !isProjectRebuild && isMake;
|
||||
myDelegateMessageHandler = delegateMessageHandler;
|
||||
myProjectPaths = new ProjectPaths(pd.jpsProject);
|
||||
myProjectPaths = new ProjectPaths(pd.getProject());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,12 +102,13 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
|
||||
@Override
|
||||
@NotNull
|
||||
public ProcessorConfigProfile getAnnotationProcessingProfile(JpsModule module) {
|
||||
final JpsJavaCompilerConfiguration compilerConfig = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(getProjectDescriptor().jpsProject);
|
||||
final JpsJavaCompilerConfiguration compilerConfig = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(
|
||||
getProjectDescriptor().getProject());
|
||||
Map<JpsModule, ProcessorConfigProfile> map = myAnnotationProcessingProfileMap;
|
||||
if (map == null) {
|
||||
map = new HashMap<JpsModule, ProcessorConfigProfile>();
|
||||
final Map<String, JpsModule> namesMap = new HashMap<String, JpsModule>();
|
||||
for (JpsModule m : getProjectDescriptor().jpsProject.getModules()) {
|
||||
for (JpsModule m : getProjectDescriptor().getProject().getModules()) {
|
||||
namesMap.put(m.getName(), m);
|
||||
}
|
||||
if (!namesMap.isEmpty()) {
|
||||
|
||||
@@ -130,7 +130,7 @@ public class FSOperations {
|
||||
ModuleBuildTarget target,
|
||||
Timestamps timestamps, boolean forceMarkDirty,
|
||||
@Nullable THashSet<File> currentFiles) throws IOException {
|
||||
final ModuleExcludeIndex rootsIndex = context.getProjectDescriptor().moduleExcludeIndex;
|
||||
final ModuleExcludeIndex rootsIndex = context.getProjectDescriptor().getModuleExcludeIndex();
|
||||
final Set<File> excludes = new HashSet<File>(rootsIndex.getModuleExcludes(target.getModule()));
|
||||
for (RootDescriptor rd : context.getProjectDescriptor().getBuildRootIndex().getTargetRoots(target, context)) {
|
||||
if (!rd.root.exists()) {
|
||||
|
||||
@@ -262,7 +262,7 @@ public class IncProjectBuilder {
|
||||
private void cleanOutputRoots(CompileContext context) throws ProjectBuildException {
|
||||
// whole project is affected
|
||||
final boolean shouldClear = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(
|
||||
context.getProjectDescriptor().jpsProject).isClearOutputDirectoryOnRebuild();
|
||||
context.getProjectDescriptor().getProject()).isClearOutputDirectoryOnRebuild();
|
||||
try {
|
||||
if (shouldClear) {
|
||||
clearOutputs(context);
|
||||
|
||||
+1
-2
@@ -3,7 +3,6 @@ package org.jetbrains.jps.incremental.artifacts;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.ProjectPaths;
|
||||
import org.jetbrains.jps.builders.BuildRootDescriptor;
|
||||
import org.jetbrains.jps.builders.BuildRootIndex;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
@@ -105,7 +104,7 @@ public class ArtifactBuildTarget extends BuildTarget<ArtifactRootDescriptor> {
|
||||
@Override
|
||||
public List<ArtifactRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex) {
|
||||
ArtifactInstructionsBuilderImpl builder = new ArtifactInstructionsBuilderImpl(index, ignoredFileIndex, this);
|
||||
ArtifactInstructionsBuilderContext context = new ArtifactInstructionsBuilderContextImpl(model, new ProjectPaths(model.getProject()));
|
||||
ArtifactInstructionsBuilderContext context = new ArtifactInstructionsBuilderContextImpl();
|
||||
String outputPath = StringUtil.notNullize(myArtifact.getOutputPath());
|
||||
final CopyToDirectoryInstructionCreator instructionCreator = new CopyToDirectoryInstructionCreator(builder, outputPath);
|
||||
LayoutElementBuildersRegistry.getInstance().generateInstructions(myArtifact, instructionCreator, context);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class IncArtifactBuilder extends TargetBuilder<ArtifactBuildTarget> {
|
||||
return;
|
||||
}
|
||||
final ProjectDescriptor pd = context.getProjectDescriptor();
|
||||
final ArtifactSorter sorter = new ArtifactSorter(pd.jpsModel);
|
||||
final ArtifactSorter sorter = new ArtifactSorter(pd.getModel());
|
||||
final Map<JpsArtifact, JpsArtifact> selfIncludingNameMap = sorter.getArtifactToSelfIncludingNameMap();
|
||||
final JpsArtifact selfIncluding = selfIncludingNameMap.get(artifact);
|
||||
if (selfIncluding != null) {
|
||||
|
||||
-11
@@ -1,9 +1,5 @@
|
||||
package org.jetbrains.jps.incremental.artifacts.instructions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.ProjectPaths;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
import org.jetbrains.jps.model.JpsProject;
|
||||
import org.jetbrains.jps.model.artifact.JpsArtifact;
|
||||
|
||||
/**
|
||||
@@ -11,13 +7,6 @@ import org.jetbrains.jps.model.artifact.JpsArtifact;
|
||||
*/
|
||||
public interface ArtifactInstructionsBuilderContext {
|
||||
|
||||
@NotNull
|
||||
ProjectPaths getProjectPaths();
|
||||
|
||||
JpsProject getJpsProject();
|
||||
|
||||
JpsModel getJpsModel();
|
||||
|
||||
boolean enterArtifact(JpsArtifact artifact);
|
||||
|
||||
void leaveArtifact(JpsArtifact artifact);
|
||||
|
||||
+1
-27
@@ -1,9 +1,5 @@
|
||||
package org.jetbrains.jps.incremental.artifacts.instructions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.ProjectPaths;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
import org.jetbrains.jps.model.JpsProject;
|
||||
import org.jetbrains.jps.model.artifact.JpsArtifact;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -13,28 +9,12 @@ import java.util.Set;
|
||||
* @author nik
|
||||
*/
|
||||
public class ArtifactInstructionsBuilderContextImpl implements ArtifactInstructionsBuilderContext {
|
||||
private final JpsProject myJpsProject;
|
||||
private final ProjectPaths myProjectPaths;
|
||||
private final Set<JpsArtifact> myParentArtifacts;
|
||||
private JpsModel myModel;
|
||||
|
||||
public ArtifactInstructionsBuilderContextImpl(JpsModel jpsModel, ProjectPaths projectPaths) {
|
||||
myJpsProject = jpsModel.getProject();
|
||||
myModel = jpsModel;
|
||||
myProjectPaths = projectPaths;
|
||||
public ArtifactInstructionsBuilderContextImpl() {
|
||||
myParentArtifacts = new HashSet<JpsArtifact>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JpsProject getJpsProject() {
|
||||
return myJpsProject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JpsModel getJpsModel() {
|
||||
return myModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enterArtifact(JpsArtifact artifact) {
|
||||
return myParentArtifacts.add(artifact);
|
||||
@@ -44,10 +24,4 @@ public class ArtifactInstructionsBuilderContextImpl implements ArtifactInstructi
|
||||
public void leaveArtifact(JpsArtifact artifact) {
|
||||
myParentArtifacts.remove(artifact);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ProjectPaths getProjectPaths() {
|
||||
return myProjectPaths;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,8 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
});
|
||||
|
||||
// force compilation of bound source file if the form is dirty
|
||||
final JpsCompilerExcludes excludes = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(context.getProjectDescriptor().jpsProject).getCompilerExcludes();
|
||||
final JpsCompilerExcludes excludes = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(
|
||||
context.getProjectDescriptor().getProject()).getCompilerExcludes();
|
||||
if (!context.isProjectRebuild()) {
|
||||
for (Iterator<File> formsIterator = formsToCompile.iterator(); formsIterator.hasNext(); ) {
|
||||
final File form = formsIterator.next();
|
||||
@@ -311,7 +312,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
final ProjectPaths paths = context.getProjectPaths();
|
||||
final ProjectDescriptor pd = context.getProjectDescriptor();
|
||||
final boolean addNotNullAssertions = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(
|
||||
pd.jpsProject).isAddNotNullAssertions();
|
||||
pd.getProject()).isAddNotNullAssertions();
|
||||
|
||||
final Collection<File> classpath =
|
||||
paths.getCompilationClasspath(chunk, false/*context.isProjectRebuild()*/);
|
||||
@@ -365,7 +366,8 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
try {
|
||||
context.processMessage(new ProgressMessage("Instrumenting forms [" + chunkName + "]"));
|
||||
instrumentForms(context, chunk, chunkSourcePath, finder, forms, outputSink);
|
||||
JpsUiDesignerConfiguration configuration = JpsUiDesignerExtensionService.getInstance().getUiDesignerConfiguration(pd.jpsProject);
|
||||
JpsUiDesignerConfiguration configuration = JpsUiDesignerExtensionService.getInstance().getUiDesignerConfiguration(
|
||||
pd.getProject());
|
||||
if (configuration != null && configuration.isCopyFormsRuntimeToOutput() && !chunk.containsTests()) {
|
||||
for (JpsModule module : chunk.getModules()) {
|
||||
final File outputDir = paths.getModuleOutputDir(module, false);
|
||||
@@ -505,7 +507,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
}
|
||||
|
||||
private static boolean useEclipseCompiler(CompileContext context) {
|
||||
JpsProject project = context.getProjectDescriptor().jpsProject;
|
||||
JpsProject project = context.getProjectDescriptor().getProject();
|
||||
return USE_EMBEDDED_JAVAC && "Eclipse".equalsIgnoreCase(JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project).getJavaCompilerId());
|
||||
}
|
||||
|
||||
@@ -625,7 +627,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
}
|
||||
|
||||
private static int getJavacServerHeapSize(CompileContext context) {
|
||||
final JpsProject project = context.getProjectDescriptor().jpsProject;
|
||||
final JpsProject project = context.getProjectDescriptor().getProject();
|
||||
final JpsJavaCompilerConfiguration config = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
|
||||
final JpsJavaCompilerOptions options = config.getCurrentCompilerOptions();
|
||||
return options.MAXIMUM_HEAP_SIZE;
|
||||
@@ -705,7 +707,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
}
|
||||
|
||||
JpsJavaCompilerConfiguration compilerConfiguration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(
|
||||
context.getProjectDescriptor().jpsProject);
|
||||
context.getProjectDescriptor().getProject());
|
||||
String bytecodeTarget = null;
|
||||
int chunkSdkVersion = -1;
|
||||
for (JpsModule module : chunk.getModules()) {
|
||||
@@ -823,7 +825,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
final List<String> options = new ArrayList<String>();
|
||||
final List<String> vmOptions = new ArrayList<String>();
|
||||
|
||||
final JpsProject project = context.getProjectDescriptor().jpsProject;
|
||||
final JpsProject project = context.getProjectDescriptor().getProject();
|
||||
final JpsJavaCompilerConfiguration compilerConfig = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
|
||||
final boolean useEclipseCompiler = useEclipseCompiler(context);
|
||||
final JpsJavaCompilerOptions compilerOptions = compilerConfig.getCurrentCompilerOptions();
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ResourcesBuilder extends ModuleLevelBuilder {
|
||||
// init patterns
|
||||
ResourcePatterns patterns = ResourcePatterns.KEY.get(context);
|
||||
if (patterns == null) {
|
||||
ResourcePatterns.KEY.set(context, new ResourcePatterns(context.getProjectDescriptor().jpsProject));
|
||||
ResourcePatterns.KEY.set(context, new ResourcePatterns(context.getProjectDescriptor().getProject()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public abstract class IncrementalTestCase extends JpsBuildTestCase {
|
||||
});
|
||||
|
||||
String outputPath = getAbsolutePath("out");
|
||||
JpsJavaExtensionService.getInstance().getOrCreateProjectExtension(myJpsProject).setOutputUrl(JpsPathUtil.pathToUrl(outputPath));
|
||||
JpsJavaExtensionService.getInstance().getOrCreateProjectExtension(myProject).setOutputUrl(JpsPathUtil.pathToUrl(outputPath));
|
||||
}
|
||||
|
||||
protected String getUrl(String pathRelativeToProjectRoot) {
|
||||
@@ -244,7 +244,7 @@ public abstract class IncrementalTestCase extends JpsBuildTestCase {
|
||||
}
|
||||
|
||||
protected JpsLibrary addLibrary(final String jarPath) {
|
||||
JpsLibrary library = myJpsProject.addLibrary("l", JpsJavaLibraryType.INSTANCE);
|
||||
JpsLibrary library = myProject.addLibrary("l", JpsJavaLibraryType.INSTANCE);
|
||||
library.addRoot(new File(getAbsolutePath(jarPath)), JpsOrderRootType.COMPILED);
|
||||
return library;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import java.util.Set;
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class JpsBuildTestCase extends UsefulTestCase {
|
||||
protected JpsProject myJpsProject;
|
||||
protected JpsProject myProject;
|
||||
protected JpsModel myModel;
|
||||
private File myDataStorageRoot;
|
||||
|
||||
@@ -49,7 +49,7 @@ public abstract class JpsBuildTestCase extends UsefulTestCase {
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
myModel = JpsElementFactory.getInstance().createModel();
|
||||
myJpsProject = myModel.getProject();
|
||||
myProject = myModel.getProject();
|
||||
myDataStorageRoot = FileUtil.createTempDirectory("compile-server-" + getProjectName(), null);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public abstract class JpsBuildTestCase extends UsefulTestCase {
|
||||
String testDataRootPath = getTestDataRootPath();
|
||||
String fullProjectPath = FileUtil.toSystemDependentName(testDataRootPath != null ? testDataRootPath + "/" + projectPath : projectPath);
|
||||
pathVariables = addPathVariables(pathVariables);
|
||||
JpsProjectLoader.loadProject(myJpsProject, pathVariables, fullProjectPath);
|
||||
JpsProjectLoader.loadProject(myProject, pathVariables, fullProjectPath);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -121,7 +121,7 @@ public abstract class JpsBuildTestCase extends UsefulTestCase {
|
||||
String[] srcPaths,
|
||||
@Nullable final String outputPath,
|
||||
final JpsSdk<JpsDummyElement> jdk) {
|
||||
final JpsModule module = myJpsProject.addModule(moduleName, JpsJavaModuleType.INSTANCE);
|
||||
final JpsModule module = myProject.addModule(moduleName, JpsJavaModuleType.INSTANCE);
|
||||
module.getSdkReferencesTable().setSdkReference(JpsJavaSdkType.INSTANCE, jdk.createReference());
|
||||
module.getDependenciesList().addSdkDependency(JpsJavaSdkType.INSTANCE);
|
||||
if (srcPaths.length > 0) {
|
||||
|
||||
@@ -50,17 +50,17 @@ public class ModuleClasspathTest extends JpsRebuildTestCase {
|
||||
}
|
||||
|
||||
private ProjectPaths getProjectPaths() {
|
||||
return new ProjectPaths(myJpsProject)
|
||||
return new ProjectPaths(myProject)
|
||||
}
|
||||
|
||||
private def assertClasspath(String moduleName, boolean includeTests, List<String> expected) {
|
||||
ModuleChunk chunk = createChunk(moduleName)
|
||||
final List<String> classpath = getPathsList(new ProjectPaths(myJpsProject).getCompilationClasspathFiles(chunk, includeTests, true, true))
|
||||
final List<String> classpath = getPathsList(new ProjectPaths(myProject).getCompilationClasspathFiles(chunk, includeTests, true, true))
|
||||
assertClasspath(expected, toSystemIndependentPaths(classpath))
|
||||
}
|
||||
|
||||
private ModuleChunk createChunk(String moduleName) {
|
||||
def module = myJpsProject.modules.find {it.name == moduleName}
|
||||
def module = myProject.modules.find {it.name == moduleName}
|
||||
return new ModuleChunk([new ModuleBuildTarget(module, JavaModuleBuildTargetType.PRODUCTION)] as Set)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ abstract class JpsRebuildTestCase extends JpsBuildTestCase {
|
||||
}
|
||||
|
||||
protected void rebuild() {
|
||||
JpsJavaExtensionService.getInstance().getOrCreateProjectExtension(myJpsProject).outputUrl = JpsPathUtil.pathToUrl(FileUtil.toSystemIndependentName(getOrCreateOutputDirectory().getAbsolutePath()))
|
||||
JpsJavaExtensionService.getInstance().getOrCreateProjectExtension(myProject).outputUrl = JpsPathUtil.pathToUrl(FileUtil.toSystemIndependentName(getOrCreateOutputDirectory().getAbsolutePath()))
|
||||
doRebuild()
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -64,7 +64,7 @@ public abstract class ArtifactBuilderTestCase extends JpsBuildTestCase {
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
for (JpsArtifact artifact : JpsArtifactService.getInstance().getArtifacts(myJpsProject)) {
|
||||
for (JpsArtifact artifact : JpsArtifactService.getInstance().getArtifacts(myProject)) {
|
||||
String outputPath = artifact.getOutputPath();
|
||||
if (outputPath != null) {
|
||||
FileUtil.delete(new File(FileUtil.toSystemDependentName(outputPath)));
|
||||
@@ -97,7 +97,7 @@ public abstract class ArtifactBuilderTestCase extends JpsBuildTestCase {
|
||||
|
||||
private Set<String> getArtifactNames() {
|
||||
Set<String> usedNames = new HashSet<String>();
|
||||
for (JpsArtifact artifact : JpsArtifactService.getInstance().getArtifacts(myJpsProject)) {
|
||||
for (JpsArtifact artifact : JpsArtifactService.getInstance().getArtifacts(myProject)) {
|
||||
usedNames.add(artifact.getName());
|
||||
}
|
||||
return usedNames;
|
||||
@@ -117,7 +117,7 @@ public abstract class ArtifactBuilderTestCase extends JpsBuildTestCase {
|
||||
|
||||
protected JpsArtifact addArtifact(String name, LayoutElementTestUtil.LayoutElementCreator root) {
|
||||
assertFalse("JpsArtifact " + name + " already exists", getArtifactNames().contains(name));
|
||||
JpsArtifact artifact = JpsArtifactService.getInstance().addArtifact(myJpsProject, name, root.buildElement(), DirectoryArtifactType.INSTANCE,
|
||||
JpsArtifact artifact = JpsArtifactService.getInstance().addArtifact(myProject, name, root.buildElement(), DirectoryArtifactType.INSTANCE,
|
||||
JpsElementFactory.getInstance().createDummyElement());
|
||||
artifact.setOutputPath(getAbsolutePath("out/artifacts/" + name));
|
||||
return artifact;
|
||||
@@ -135,13 +135,13 @@ public abstract class ArtifactBuilderTestCase extends JpsBuildTestCase {
|
||||
}
|
||||
|
||||
protected JpsLibrary addProjectLibrary(String name, String jarPath) {
|
||||
final JpsLibrary library = myJpsProject.getLibraryCollection().addLibrary(name, JpsJavaLibraryType.INSTANCE);
|
||||
final JpsLibrary library = myProject.getLibraryCollection().addLibrary(name, JpsJavaLibraryType.INSTANCE);
|
||||
library.addRoot(JpsPathUtil.pathToUrl(jarPath), JpsOrderRootType.COMPILED);
|
||||
return library;
|
||||
}
|
||||
|
||||
protected void buildAll() {
|
||||
Collection<JpsArtifact> artifacts = JpsArtifactService.getInstance().getArtifacts(myJpsProject);
|
||||
Collection<JpsArtifact> artifacts = JpsArtifactService.getInstance().getArtifacts(myProject);
|
||||
buildArtifacts(artifacts.toArray(new JpsArtifact[artifacts.size()]));
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public class AndroidDexBuilder extends TargetBuilder<AndroidProjectBuildTarget>
|
||||
@NotNull AndroidFileSetStorage proguardStateStorage) throws IOException {
|
||||
boolean success = true;
|
||||
|
||||
for (JpsModule module : context.getProjectDescriptor().jpsProject.getModules()) {
|
||||
for (JpsModule module : context.getProjectDescriptor().getProject().getModules()) {
|
||||
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(module);
|
||||
if (extension == null || extension.isLibrary()) {
|
||||
continue;
|
||||
@@ -344,7 +344,7 @@ public class AndroidDexBuilder extends TargetBuilder<AndroidProjectBuildTarget>
|
||||
|
||||
final JpsSdk<JpsSimpleElement<JpsAndroidSdkProperties>> sdk = platform.getSdk();
|
||||
final String jdkName = sdk.getSdkProperties().getData().getJdkName();
|
||||
final JpsLibrary javaSdk = context.getProjectDescriptor().jpsModel.getGlobal().getLibraryCollection().findLibrary(jdkName);
|
||||
final JpsLibrary javaSdk = context.getProjectDescriptor().getModel().getGlobal().getLibraryCollection().findLibrary(jdkName);
|
||||
if (javaSdk == null || !javaSdk.getType().equals(JpsJavaSdkType.INSTANCE)) {
|
||||
context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, AndroidJpsBundle.message("android.jps.errors.java.sdk.not.specified", jdkName)));
|
||||
return false;
|
||||
|
||||
+3
-3
@@ -62,7 +62,7 @@ public class AndroidPackagingBuilder extends TargetBuilder<AndroidProjectBuildTa
|
||||
if (target.getKind() != AndroidProjectBuildTarget.AndroidBuilderKind.PACKAGING || AndroidJpsUtil.isLightBuild(context)) {
|
||||
return;
|
||||
}
|
||||
final Collection<JpsModule> modules = context.getProjectDescriptor().jpsProject.getModules();
|
||||
final Collection<JpsModule> modules = context.getProjectDescriptor().getProject().getModules();
|
||||
final Map<JpsModule, AndroidFileSetState> resourcesStates = new HashMap<JpsModule, AndroidFileSetState>();
|
||||
final Map<JpsModule, AndroidFileSetState> assetsStates = new HashMap<JpsModule, AndroidFileSetState>();
|
||||
final Map<JpsModule, File> manifestFiles = new HashMap<JpsModule, File>();
|
||||
@@ -384,7 +384,7 @@ public class AndroidPackagingBuilder extends TargetBuilder<AndroidProjectBuildTa
|
||||
final List<AndroidNativeLibData> additionalNativeLibs = extension.getAdditionalNativeLibs();
|
||||
|
||||
final AndroidFileSetState currentFileSetState =
|
||||
buildCurrentApkBuilderState(context.getProjectDescriptor().jpsProject, resPackagePath, classesDexFilePath, nativeLibDirs, sourceRoots,
|
||||
buildCurrentApkBuilderState(context.getProjectDescriptor().getProject(), resPackagePath, classesDexFilePath, nativeLibDirs, sourceRoots,
|
||||
externalJars, release);
|
||||
|
||||
final AndroidApkBuilderConfigState currentApkBuilderConfigState =
|
||||
@@ -404,7 +404,7 @@ public class AndroidPackagingBuilder extends TargetBuilder<AndroidProjectBuildTa
|
||||
|
||||
final Map<AndroidCompilerMessageKind, List<String>> messages = AndroidApkBuilder
|
||||
.execute(resPackagePath, classesDexFilePath, sourceRoots, externalJars, nativeLibDirs, additionalNativeLibs,
|
||||
outputApkPath, release, sdkPath, customKeyStorePath, new MyExcludedSourcesFilter(context.getProjectDescriptor().jpsProject));
|
||||
outputApkPath, release, sdkPath, customKeyStorePath, new MyExcludedSourcesFilter(context.getProjectDescriptor().getProject()));
|
||||
|
||||
AndroidJpsUtil.addMessages(context, messages, BUILDER_NAME, module.getName());
|
||||
final boolean success = messages.get(AndroidCompilerMessageKind.ERROR).isEmpty();
|
||||
|
||||
+2
-1
@@ -313,7 +313,8 @@ public class GroovyBuilder extends ModuleLevelBuilder {
|
||||
|
||||
private static Map<String, String> buildClassToSourceMap(ModuleChunk chunk, CompileContext context, Set<String> toCompilePaths, Map<ModuleBuildTarget, String> finalOutputs) throws IOException {
|
||||
final Map<String, String> class2Src = new HashMap<String, String>();
|
||||
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(context.getProjectDescriptor().jpsProject);
|
||||
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(
|
||||
context.getProjectDescriptor().getProject());
|
||||
for (ModuleBuildTarget target : chunk.getTargets()) {
|
||||
String moduleOutputPath = finalOutputs.get(target);
|
||||
final SourceToOutputMapping srcToOut = context.getProjectDescriptor().dataManager.getSourceToOutputMap(target);
|
||||
|
||||
Reference in New Issue
Block a user