本文整理汇总了Java中org.jetbrains.jps.indices.ModuleExcludeIndex类的典型用法代码示例。如果您正苦于以下问题:Java ModuleExcludeIndex类的具体用法?Java ModuleExcludeIndex怎么用?Java ModuleExcludeIndex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleExcludeIndex类属于org.jetbrains.jps.indices包,在下文中一共展示了ModuleExcludeIndex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
public List<JavaSourceRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
List<JavaSourceRootDescriptor> roots = new ArrayList<JavaSourceRootDescriptor>();
JavaSourceRootType type = isTests() ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE;
Iterable<ExcludedJavaSourceRootProvider> excludedRootProviders = JpsServiceManager.getInstance().getExtensions(ExcludedJavaSourceRootProvider.class);
final Set<File> moduleExcludes = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
moduleExcludes.addAll(index.getModuleExcludes(myModule));
roots_loop:
for (JpsTypedModuleSourceRoot<JavaSourceRootProperties> sourceRoot : myModule.getSourceRoots(type)) {
if (JpsPathUtil.isUnder(moduleExcludes, sourceRoot.getFile())) {
continue;
}
for (ExcludedJavaSourceRootProvider provider : excludedRootProviders) {
if (provider.isExcludedFromCompilation(myModule, sourceRoot)) {
continue roots_loop;
}
}
final String packagePrefix = sourceRoot.getProperties().getPackagePrefix();
roots.add(new JavaSourceRootDescriptor(sourceRoot.getFile(), this, false, false, packagePrefix,
computeRootExcludes(sourceRoot.getFile(), index)));
}
return roots;
}
示例2: addRoots
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
private <R extends BuildRootDescriptor> void addRoots(BuildDataPaths dataPaths, Iterable<AdditionalRootsProviderService> rootsProviders,
BuildTarget<R> target,
JpsModel model,
ModuleExcludeIndex index,
IgnoredFileIndex ignoredFileIndex) {
List<R> descriptors = target.computeRootDescriptors(model, index, ignoredFileIndex, dataPaths);
for (AdditionalRootsProviderService<?> provider : rootsProviders) {
if (provider.getTargetTypes().contains(target.getTargetType())) {
//noinspection unchecked
AdditionalRootsProviderService<R> providerService = (AdditionalRootsProviderService<R>)provider;
final List<R> additionalRoots = providerService.getAdditionalRoots(target, dataPaths);
if (!additionalRoots.isEmpty()) {
descriptors = new ArrayList<R>(descriptors);
descriptors.addAll(additionalRoots);
}
}
}
for (BuildRootDescriptor descriptor : descriptors) {
registerDescriptor(descriptor);
}
if (descriptors instanceof ArrayList<?>) {
((ArrayList)descriptors).trimToSize();
}
myRootsByTarget.put(target, descriptors);
}
示例3: createProjectDescriptor
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
protected ProjectDescriptor createProjectDescriptor(final BuildLoggingManager buildLoggingManager) {
try {
BuildTargetRegistryImpl targetRegistry = new BuildTargetRegistryImpl(myModel);
ModuleExcludeIndex index = new ModuleExcludeIndexImpl(myModel);
IgnoredFileIndexImpl ignoredFileIndex = new IgnoredFileIndexImpl(myModel);
BuildDataPaths dataPaths = new BuildDataPathsImpl(myDataStorageRoot);
BuildRootIndexImpl buildRootIndex = new BuildRootIndexImpl(targetRegistry, myModel, index, dataPaths, ignoredFileIndex);
BuildTargetIndexImpl targetIndex = new BuildTargetIndexImpl(targetRegistry, buildRootIndex);
BuildTargetsState targetsState = new BuildTargetsState(dataPaths, myModel, buildRootIndex);
ProjectTimestamps timestamps = new ProjectTimestamps(myDataStorageRoot, targetsState);
BuildDataManager dataManager = new BuildDataManager(dataPaths, targetsState, true);
return new ProjectDescriptor(myModel, new BuildFSState(true), timestamps, dataManager, buildLoggingManager, index, targetsState,
targetIndex, buildRootIndex, ignoredFileIndex);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
示例4: computeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
public List<MyRootDescriptor> computeRootDescriptors(JpsModel model,
ModuleExcludeIndex index,
IgnoredFileIndex ignoredFileIndex,
BuildDataPaths dataPaths) {
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(myModule);
assert extension != null;
final List<MyRootDescriptor> result = new ArrayList<MyRootDescriptor>();
final File manifestFile = AndroidJpsUtil.getManifestFileForCompilationPath(extension);
if (manifestFile != null) {
result.add(new MyRootDescriptor(this, manifestFile, false));
}
for (JpsAndroidModuleExtension libExtension : AndroidJpsUtil.getAllAndroidDependencies(myModule, true)) {
final File libManifest = AndroidJpsUtil.getManifestFileForCompilationPath(libExtension);
if (libManifest != null && libManifest.exists()) {
result.add(new MyRootDescriptor(this, libManifest, true));
}
}
return result;
}
示例5: doComputeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
protected List<BuildRootDescriptor> doComputeRootDescriptors(JpsModel model,
ModuleExcludeIndex index,
IgnoredFileIndex ignoredFileIndex,
BuildDataPaths dataPaths) {
final File moduleOutputDir = ProjectPaths.getModuleOutputDir(myModule, false);
if (moduleOutputDir != null) {
return Collections.<BuildRootDescriptor>singletonList(
new AndroidClassesDirBuildRootDescriptor(this, moduleOutputDir));
}
else {
return Collections.emptyList();
}
}
示例6: doComputeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
protected List<BuildRootDescriptor> doComputeRootDescriptors(JpsModel model,
ModuleExcludeIndex index,
IgnoredFileIndex ignoredFileIndex,
BuildDataPaths dataPaths) {
final Set<JpsLibrary> libraries = JpsJavaExtensionService.getInstance().enumerateDependencies(
Collections.singleton(myModule)).runtimeOnly().productionOnly().getLibraries();
final List<BuildRootDescriptor> result = new ArrayList<BuildRootDescriptor>();
for (JpsLibrary library : libraries) {
final Pair<File, List<File>> pair = AndroidJpsUtil.getResDirAndJarsIfAar(library);
final List<File> jars = pair != null ? pair.getSecond() : null;
if (jars != null) {
for (File jar : jars) {
result.add(new BuildRootDescriptorImpl(this, jar));
}
}
}
return result;
}
示例7: computeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
public List<GradleResourceRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
final List<GradleResourceRootDescriptor> result = new ArrayList<GradleResourceRootDescriptor>();
GradleProjectConfiguration projectConfig = JpsGradleExtensionService.getInstance().getGradleProjectConfiguration(dataPaths);
GradleModuleResourceConfiguration moduleConfig = projectConfig.moduleConfigurations.get(myModule.getName());
if (moduleConfig == null) return Collections.emptyList();
int i = 0;
for (ResourceRootConfiguration resource : getRootConfigurations(moduleConfig)) {
result.add(new GradleResourceRootDescriptor(this, resource, i++, moduleConfig.overwrite));
}
return result;
}
示例8: computeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
public List<MavenResourceRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
// todo: should we honor ignored and excluded roots here?
final List<MavenResourceRootDescriptor> result = new ArrayList<MavenResourceRootDescriptor>();
MavenModuleResourceConfiguration moduleConfig = getModuleResourcesConfiguration(dataPaths);
if (moduleConfig == null) return Collections.emptyList();
int i = 0;
for (ResourceRootConfiguration resource : getRootConfigurations(moduleConfig)) {
result.add(new MavenResourceRootDescriptor(this, resource, i++, moduleConfig.overwrite));
}
return result;
}
示例9: computeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
public List<JavaSourceRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
List<JavaSourceRootDescriptor> roots = new ArrayList<JavaSourceRootDescriptor>();
JavaSourceRootType type = isTests() ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE;
Iterable<ExcludedJavaSourceRootProvider> excludedRootProviders = JpsServiceManager.getInstance().getExtensions(ExcludedJavaSourceRootProvider.class);
final Set<File> moduleExcludes = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
moduleExcludes.addAll(index.getModuleExcludes(myModule));
roots_loop:
for (JpsTypedModuleSourceRoot<JpsSimpleElement<JavaSourceRootProperties>> sourceRoot : myModule.getSourceRoots(type)) {
if (JpsPathUtil.isUnder(moduleExcludes, sourceRoot.getFile())) {
continue;
}
for (ExcludedJavaSourceRootProvider provider : excludedRootProviders) {
if (provider.isExcludedFromCompilation(myModule, sourceRoot)) {
continue roots_loop;
}
}
final String packagePrefix = sourceRoot.getProperties().getData().getPackagePrefix();
roots.add(new JavaSourceRootDescriptor(sourceRoot.getFile(), this, false, false, packagePrefix,
computeRootExcludes(sourceRoot.getFile(), index)));
}
return roots;
}
示例10: computeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
public List<ResourceRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
List<ResourceRootDescriptor> roots = new ArrayList<ResourceRootDescriptor>();
JavaSourceRootType type = isTests() ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE;
Iterable<ExcludedJavaSourceRootProvider> excludedRootProviders = JpsServiceManager.getInstance().getExtensions(ExcludedJavaSourceRootProvider.class);
roots_loop:
for (JpsTypedModuleSourceRoot<JpsSimpleElement<JavaSourceRootProperties>> sourceRoot : myModule.getSourceRoots(type)) {
for (ExcludedJavaSourceRootProvider provider : excludedRootProviders) {
if (provider.isExcludedFromCompilation(myModule, sourceRoot)) {
continue roots_loop;
}
}
final String packagePrefix = sourceRoot.getProperties().getData().getPackagePrefix();
final File rootFile = sourceRoot.getFile();
roots.add(new ResourceRootDescriptor(rootFile, this, false, packagePrefix, computeRootExcludes(rootFile, index)));
}
return roots;
}
示例11: addRoots
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
private <R extends BuildRootDescriptor> void addRoots(BuildDataPaths dataPaths, Iterable<AdditionalRootsProviderService> rootsProviders,
BuildTarget<R> target,
JpsModel model,
ModuleExcludeIndex index,
IgnoredFileIndex ignoredFileIndex) {
List<R> descriptors = target.computeRootDescriptors(model, index, ignoredFileIndex, dataPaths);
for (AdditionalRootsProviderService<?> provider : rootsProviders) {
if (provider.getTargetTypes().contains(target.getTargetType())) {
//noinspection unchecked
AdditionalRootsProviderService<R> providerService = (AdditionalRootsProviderService<R>)provider;
final List<R> additionalRoots = providerService.getAdditionalRoots(target, dataPaths);
if (!additionalRoots.isEmpty()) {
descriptors = new ArrayList<R>(descriptors);
descriptors.addAll(additionalRoots);
}
}
}
for (BuildRootDescriptor descriptor : descriptors) {
registerDescriptor(descriptor);
}
myRootsByTarget.put(target, descriptors);
}
示例12: createProjectDescriptor
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
protected ProjectDescriptor createProjectDescriptor(final BuildLoggingManager buildLoggingManager) {
try {
BuildTargetIndexImpl targetIndex = new BuildTargetIndexImpl(myModel);
ModuleExcludeIndex index = new ModuleExcludeIndexImpl(myModel);
IgnoredFileIndexImpl ignoredFileIndex = new IgnoredFileIndexImpl(myModel);
BuildDataPaths dataPaths = new BuildDataPathsImpl(myDataStorageRoot);
BuildRootIndexImpl buildRootIndex = new BuildRootIndexImpl(targetIndex, myModel, index, dataPaths, ignoredFileIndex);
BuildTargetsState targetsState = new BuildTargetsState(dataPaths, myModel, buildRootIndex);
ProjectTimestamps timestamps = new ProjectTimestamps(myDataStorageRoot, targetsState);
BuildDataManager dataManager = new BuildDataManager(dataPaths, targetsState, true);
return new ProjectDescriptor(myModel, new BuildFSState(true), timestamps, dataManager, buildLoggingManager, index, targetsState,
targetIndex, buildRootIndex, ignoredFileIndex);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
示例13: computeRootDescriptors
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
@NotNull
@Override
public List<ArtifactRootDescriptor> computeRootDescriptors(JpsModel model,
ModuleExcludeIndex index,
IgnoredFileIndex ignoredFileIndex,
BuildDataPaths dataPaths) {
ArtifactInstructionsBuilderImpl builder = new ArtifactInstructionsBuilderImpl(index, ignoredFileIndex, this, model, dataPaths);
ArtifactInstructionsBuilderContext context = new ArtifactInstructionsBuilderContextImpl(model, dataPaths);
String outputPath = StringUtil.notNullize(myArtifact.getOutputPath());
final CopyToDirectoryInstructionCreator instructionCreator = new CopyToDirectoryInstructionCreator(builder, outputPath);
LayoutElementBuildersRegistry.getInstance().generateInstructions(myArtifact, instructionCreator, context);
return builder.getDescriptors();
}
示例14: ArtifactInstructionsBuilderImpl
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
public ArtifactInstructionsBuilderImpl(@NotNull ModuleExcludeIndex rootsIndex,
@NotNull IgnoredFileIndex ignoredFileIndex,
@NotNull ArtifactBuildTarget target,
@NotNull JpsModel model, @NotNull BuildDataPaths dataPaths) {
myRootsIndex = rootsIndex;
myIgnoredFileIndex = ignoredFileIndex;
myBuildTarget = target;
myModel = model;
myBuildDataPaths = dataPaths;
myJarByPath = new HashMap<String, JarInfo>();
myDescriptors = new ArrayList<ArtifactRootDescriptor>();
myCopyingHandlerProviders = JpsServiceManager.getInstance().getExtensions(ArtifactRootCopyingHandlerProvider.class);
}
示例15: SourceFileFilterImpl
import org.jetbrains.jps.indices.ModuleExcludeIndex; //导入依赖的package包/类
private SourceFileFilterImpl(@Nullable SourceFileFilter baseFilter,
@NotNull ModuleExcludeIndex rootsIndex,
IgnoredFileIndex patterns,
boolean includeExcluded) {
myBaseFilter = baseFilter;
myRootsIndex = rootsIndex;
myIgnoredFileIndex = patterns;
myIncludeExcluded = includeExcluded;
}