本文整理汇总了Java中org.jetbrains.jps.ModuleChunk.getModules方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleChunk.getModules方法的具体用法?Java ModuleChunk.getModules怎么用?Java ModuleChunk.getModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jetbrains.jps.ModuleChunk
的用法示例。
在下文中一共展示了ModuleChunk.getModules方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
@Override
public ExitCode build(final CompileContext context,
ModuleChunk chunk,
DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder,
OutputConsumer outputConsumer)
throws ProjectBuildException, IOException {
boolean doneSomething = false;
for (final JpsModule module : chunk.getModules()) {
JpsAppEngineModuleExtension extension = JpsAppEngineExtensionService.getInstance().getExtension(module);
if (extension != null && extension.isRunEnhancerOnMake()) {
doneSomething |= processModule(context, dirtyFilesHolder, extension);
}
}
return doneSomething ? ExitCode.OK : ExitCode.NOTHING_DONE;
}
示例2: getModulesToBuild
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private List<JpsModule> getModulesToBuild(final ModuleChunk chunk) {
final List<JpsModule> modules = new ArrayList<>();
for (final JpsModule module : chunk.getModules()) {
@Nullable final JpsMetaborgModuleFacetConfig facetConfiguration
= this.extensionService.getFacetConfiguration(module);
// The module must have a Metaborg facet and NOT have a Metaborg configuration,
// as a Metaborg configuration indicates it's a Language Specification project
// which is treated differently.
if (facetConfiguration == null) continue;
if (this.extensionService.hasModuleConfiguration(module)) {
this.logger.warn("Language Specification module should not have Metaborg facet: {}", module);
continue;
}
modules.add(module);
}
return modules;
}
示例3: getBindingFileList
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private String[] getBindingFileList(final ModuleChunk moduleChunk) {
HashSet<String> bindings = new HashSet<String>();
for (JpsModule module : moduleChunk.getModules()){
for (String rootUrl : module.getContentRootsList().getUrls()){
File root = JpsPathUtil.urlToFile(rootUrl);
File jibxRoot = new File(root, "jibx");
if (jibxRoot.exists() && jibxRoot.isDirectory()){
File[] files = jibxRoot.listFiles();
if (files != null) {
for (File binding : files) {
bindings.add(binding.getAbsolutePath());
}
}
}
}
}
return bindings.toArray(new String[bindings.size()]);
}
示例4: getChunkSdkVersion
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static int getChunkSdkVersion(ModuleChunk chunk) {
int chunkSdkVersion = -1;
for (JpsModule module : chunk.getModules()) {
final JpsSdk<JpsDummyElement> sdk = module.getSdk(JpsJavaSdkType.INSTANCE);
if (sdk != null) {
final int moduleSdkVersion = convertToNumber(sdk.getVersionString());
if (moduleSdkVersion != 0 /*could determine the version*/&& (chunkSdkVersion < 0 || chunkSdkVersion > moduleSdkVersion)) {
chunkSdkVersion = moduleSdkVersion;
}
}
}
return chunkSdkVersion;
}
示例5: getChunkSdkHome
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static String getChunkSdkHome(ModuleChunk chunk) {
for (JpsModule module : chunk.getModules()) {
final JpsSdk<JpsDummyElement> sdk = module.getSdk(JpsJavaSdkType.INSTANCE);
if (sdk != null) {
return sdk.getHomePath();
}
}
return null;
}
示例6: getPreferredModuleChunkEncoding
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
@Nullable
public String getPreferredModuleChunkEncoding(@NotNull ModuleChunk moduleChunk) {
for (JpsModule module : moduleChunk.getModules()) {
final String encoding = getPreferredModuleEncoding(module);
if (encoding != null) {
return encoding;
}
}
return myProjectCharset;
}
示例7: getAllModuleChunkEncodings
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
@NotNull
public Set<String> getAllModuleChunkEncodings(@NotNull ModuleChunk moduleChunk) {
final Map<JpsModule, Set<String>> map = getModuleCharsetMap();
Set<String> encodings = new HashSet<String>();
for (JpsModule module : moduleChunk.getModules()) {
final Set<String> moduleEncodings = map.get(module);
if (moduleEncodings != null) {
encodings.addAll(moduleEncodings);
}
}
return encodings;
}
示例8: chunkContainsAffectedFiles
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private static boolean chunkContainsAffectedFiles(CompileContext context, ModuleChunk chunk, final Set<File> affected)
throws IOException {
final Set<JpsModule> chunkModules = chunk.getModules();
if (!chunkModules.isEmpty()) {
for (File file : affected) {
final JavaSourceRootDescriptor moduleAndRoot = context.getProjectDescriptor().getBuildRootIndex().findJavaRootDescriptor(context,
file);
if (moduleAndRoot != null && chunkModules.contains(moduleAndRoot.target.getModule())) {
return true;
}
}
}
return false;
}
示例9: getFirstExtension
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
/**
* Returns the first Android-Gradle facet in the given chunk of IDEA modules.
*
* @param chunk the given chunk of IDEA modules.
* @return the first Android-Gradle facet in the given chunk of IDEA modules, or {@code null} if none of the module contain the
* Android-Gradle facet.
*/
@Nullable
public static JpsAndroidGradleModuleExtension getFirstExtension(@NotNull ModuleChunk chunk) {
for (JpsModule module : chunk.getModules()) {
JpsAndroidGradleModuleExtension extension = getExtension(module);
if (extension != null) {
return extension;
}
}
return null;
}
示例10: getFirstAndroidSdk
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
/**
* Returns the first 'Android SDK' in the given chunk of IDEA modules.
*
* @param chunk the given chunk of modules.
* @return the first 'Android SDK' in the given chunk of IDEA modules, or {@code null} if none of the modules contain an 'Android SDK.'
*/
@Nullable
public static JpsSdk<JpsSimpleElement<JpsAndroidSdkProperties>> getFirstAndroidSdk(@NotNull ModuleChunk chunk) {
for (JpsModule module : chunk.getModules()) {
JpsSdk<JpsSimpleElement<JpsAndroidSdkProperties>> sdk = module.getSdk(JpsAndroidSdkType.INSTANCE);
if (sdk != null) {
return sdk;
}
}
return null;
}
示例11: getCompilationUnitPatchers
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
@NotNull
@Override
public Collection<String> getCompilationUnitPatchers(@NotNull CompileContext context, @NotNull ModuleChunk chunk) {
for (JpsModule module : chunk.getModules()) {
if (shouldInjectGriffon(module)) {
return Collections.singleton("org.jetbrains.groovy.compiler.rt.GriffonInjector");
}
}
return Collections.emptyList();
}
示例12: ModulesBasedFileFilter
import org.jetbrains.jps.ModuleChunk; //导入方法依赖的package包/类
private ModulesBasedFileFilter(CompileContext context, ModuleChunk chunk) {
myContext = context;
myChunkModules = chunk.getModules();
myChunkTargets = chunk.getTargets();
myBuildRootIndex = context.getProjectDescriptor().getBuildRootIndex();
}