本文整理汇总了Java中org.jetbrains.jps.builders.BuildRootDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java BuildRootDescriptor类的具体用法?Java BuildRootDescriptor怎么用?Java BuildRootDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildRootDescriptor类属于org.jetbrains.jps.builders包,在下文中一共展示了BuildRootDescriptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: save
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
public void save(DataOutput out) throws IOException {
lockData();
try {
out.writeInt(myDeletedPaths.size());
for (String path : myDeletedPaths) {
IOUtil.writeString(path, out);
}
out.writeInt(myFilesToRecompile.size());
for (Map.Entry<BuildRootDescriptor, Set<File>> entry : myFilesToRecompile.entrySet()) {
IOUtil.writeString(entry.getKey().getRootId(), out);
final Set<File> files = entry.getValue();
out.writeInt(files.size());
for (File file : files) {
IOUtil.writeString(FileUtil.toSystemIndependentName(file.getPath()), out);
}
}
}
finally {
unlockData();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:FilesDelta.java
示例2: markDirtyFiles
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
static void markDirtyFiles(CompileContext context,
BuildTarget<?> target,
final CompilationRound round,
Timestamps timestamps,
boolean forceMarkDirty,
@Nullable THashSet<File> currentFiles,
@Nullable FileFilter filter) throws IOException {
if (filter == null && forceMarkDirty) {
addCompletelyMarkedDirtyTarget(context, target);
}
for (BuildRootDescriptor rd : context.getProjectDescriptor().getBuildRootIndex().getTargetRoots(target, context)) {
if (!rd.getRootFile().exists() ||
//temp roots are managed by compilers themselves
(rd instanceof JavaSourceRootDescriptor && ((JavaSourceRootDescriptor)rd).isTemp)) {
continue;
}
if (filter == null) {
context.getProjectDescriptor().fsState.clearRecompile(rd);
}
final FSCache fsCache = rd.canUseFileCache() ? context.getProjectDescriptor().getFSCache() : FSCache.NO_CACHE;
traverseRecursively(context, rd, round, rd.getRootFile(), timestamps, forceMarkDirty, currentFiles, filter, fsCache);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FSOperations.java
示例3: filesGenerated
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
@Override
public void filesGenerated(Collection<Pair<String, String>> paths) {
BuildFSState fsState = myContext.getProjectDescriptor().fsState;
BuildRootIndex rootsIndex = myContext.getProjectDescriptor().getBuildRootIndex();
for (Pair<String, String> pair : paths) {
String relativePath = pair.getSecond();
File file = relativePath.equals(".") ? new File(pair.getFirst()) : new File(pair.getFirst(), relativePath);
Collection<BuildRootDescriptor> descriptors = rootsIndex.findAllParentDescriptors(file, null, myContext);
for (BuildRootDescriptor descriptor : descriptors) {
try {
fsState.markDirty(myContext, file, descriptor, myContext.getProjectDescriptor().timestamps.getStorage(), false);
}
catch (IOException ignored) {
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ChainedTargetsBuildListener.java
示例4: buildTarget
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
@Override
protected void buildTarget(@NotNull AndroidResourcePackagingBuildTarget target,
@NotNull DirtyFilesHolder<BuildRootDescriptor, AndroidResourcePackagingBuildTarget> holder,
@NotNull BuildOutputConsumer outputConsumer,
@NotNull CompileContext context) throws ProjectBuildException, IOException {
final boolean releaseBuild = AndroidJpsUtil.isReleaseBuild(context);
final AndroidPackagingStateStorage packagingStateStorage =
context.getProjectDescriptor().dataManager.getStorage(target, AndroidPackagingStateStorage.Provider.INSTANCE);
if (!holder.hasDirtyFiles() && !holder.hasRemovedFiles()) {
final AndroidPackagingStateStorage.MyState savedState = packagingStateStorage.read();
if (savedState != null && savedState.isRelease() == releaseBuild) {
return;
}
}
assert !AndroidJpsUtil.isLightBuild(context);
if (!packageResources(target, context, outputConsumer, releaseBuild)) {
throw new StopBuildException();
}
packagingStateStorage.saveState(new AndroidPackagingStateStorage.MyState(releaseBuild));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AndroidResourcePackagingBuilder.java
示例5: doComputeRootDescriptors
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的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();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidLibraryPackagingTarget.java
示例6: doComputeRootDescriptors
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的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;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AndroidAarDepsBuildTarget.java
示例7: save
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
public void save(DataOutput out) throws IOException {
out.writeInt(myDeletedPaths.size());
synchronized (myDeletedPaths) {
for (String path : myDeletedPaths) {
IOUtil.writeString(path, out);
}
}
synchronized (myFilesToRecompile) {
out.writeInt(myFilesToRecompile.size());
for (Map.Entry<BuildRootDescriptor, Set<File>> entry : myFilesToRecompile.entrySet()) {
IOUtil.writeString(entry.getKey().getRootId(), out);
final Set<File> files = entry.getValue();
out.writeInt(files.size());
for (File file : files) {
IOUtil.writeString(FileUtil.toSystemIndependentName(file.getPath()), out);
}
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FilesDelta.java
示例8: processFilesToRecompile
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
public <R extends BuildRootDescriptor, T extends BuildTarget<R>> boolean processFilesToRecompile(CompileContext context, final T target, final FileProcessor<R, T> processor) throws IOException {
final Map<BuildRootDescriptor, Set<File>> data = getSourcesToRecompile(context, target);
final CompileScope scope = context.getScope();
synchronized (data) {
for (Map.Entry<BuildRootDescriptor, Set<File>> entry : data.entrySet()) {
//noinspection unchecked
R root = (R)entry.getKey();
for (File file : entry.getValue()) {
if (!scope.isAffected(target, file)) {
continue;
}
if (!processor.apply(target, file, root)) {
return false;
}
}
}
}
return true;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:BuildFSState.java
示例9: markDirtyFiles
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
static void markDirtyFiles(CompileContext context,
BuildTarget<?> target,
Timestamps timestamps,
boolean forceMarkDirty,
@Nullable THashSet<File> currentFiles,
@Nullable FileFilter filter) throws IOException {
for (BuildRootDescriptor rd : context.getProjectDescriptor().getBuildRootIndex().getTargetRoots(target, context)) {
if (!rd.getRootFile().exists() ||
//temp roots are managed by compilers themselves
(rd instanceof JavaSourceRootDescriptor && ((JavaSourceRootDescriptor)rd).isTemp)) {
continue;
}
if (filter == null) {
context.getProjectDescriptor().fsState.clearRecompile(rd);
}
final FSCache fsCache = rd.canUseFileCache() ? context.getProjectDescriptor().getFSCache() : FSCache.NO_CACHE;
traverseRecursively(context, rd, rd.getRootFile(), timestamps, forceMarkDirty, currentFiles, filter, fsCache);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FSOperations.java
示例10: addAll
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
private void addAll(FilesDelta other) {
other.lockData();
try {
myDeletedPaths.addAll(other.myDeletedPaths);
for (Map.Entry<BuildRootDescriptor, Set<File>> entry : other.myFilesToRecompile.entrySet()) {
_addToRecompiled(entry.getKey(), entry.getValue());
}
}
finally {
other.unlockData();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:FilesDelta.java
示例11: load
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
public void load(DataInput in, @NotNull BuildTarget<?> target, BuildRootIndex buildRootIndex) throws IOException {
lockData();
try {
myDeletedPaths.clear();
int deletedCount = in.readInt();
while (deletedCount-- > 0) {
myDeletedPaths.add(IOUtil.readString(in));
}
myFilesToRecompile.clear();
int recompileCount = in.readInt();
while (recompileCount-- > 0) {
String rootId = IOUtil.readString(in);
BuildRootDescriptor descriptor = target.findRootDescriptor(rootId, buildRootIndex);
Set<File> files;
if (descriptor != null) {
files = myFilesToRecompile.get(descriptor);
if (files == null) {
files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
myFilesToRecompile.put(descriptor, files);
}
}
else {
LOG.debug("Cannot find root by " + rootId + ", delta will be skipped");
files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
}
int filesCount = in.readInt();
while (filesCount-- > 0) {
final File file = new File(IOUtil.readString(in));
if (Utils.IS_TEST_MODE) {
LOG.info("Loaded " + file.getPath());
}
files.add(file);
}
}
}
finally {
unlockData();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:FilesDelta.java
示例12: markRecompile
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
public boolean markRecompile(BuildRootDescriptor root, File file) {
lockData();
try {
final boolean added = _addToRecompiled(root, file);
if (added) {
if (!myDeletedPaths.isEmpty()) { // optimization
myDeletedPaths.remove(FileUtil.toCanonicalPath(file.getPath()));
}
}
return added;
}
finally {
unlockData();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:FilesDelta.java
示例13: markRecompileIfNotDeleted
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
public boolean markRecompileIfNotDeleted(BuildRootDescriptor root, File file) {
lockData();
try {
final boolean isMarkedDeleted = !myDeletedPaths.isEmpty() && myDeletedPaths.contains(FileUtil.toCanonicalPath(file.getPath()));
if (!isMarkedDeleted) {
_addToRecompiled(root, file);
return true;
}
return false;
}
finally {
unlockData();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:FilesDelta.java
示例14: _addToRecompiled
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
private boolean _addToRecompiled(BuildRootDescriptor root, Collection<File> filesToAdd) {
Set<File> files = myFilesToRecompile.get(root);
if (files == null) {
files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
myFilesToRecompile.put(root, files);
}
return files.addAll(filesToAdd);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FilesDelta.java
示例15: isMarkedRecompile
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
public boolean isMarkedRecompile(BuildRootDescriptor rd, File file) {
lockData();
try {
final Set<File> files = myFilesToRecompile.get(rd);
return files != null && files.contains(file);
}
finally {
unlockData();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FilesDelta.java
示例16: clearRecompile
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
@Nullable
public Set<File> clearRecompile(BuildRootDescriptor root) {
lockData();
try {
return myFilesToRecompile.remove(root);
}
finally {
unlockData();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FilesDelta.java
示例17: traverseRecursively
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
private static void traverseRecursively(CompileContext context,
final BuildRootDescriptor rd,
final CompilationRound round,
final File file,
@NotNull final Timestamps tsStorage,
final boolean forceDirty,
@Nullable Set<File> currentFiles, @Nullable FileFilter filter, @NotNull FSCache fsCache) throws IOException {
BuildRootIndex rootIndex = context.getProjectDescriptor().getBuildRootIndex();
final File[] children = fsCache.getChildren(file);
if (children != null) { // is directory
if (children.length > 0 && rootIndex.isDirectoryAccepted(file, rd)) {
for (File child : children) {
traverseRecursively(context, rd, round, child, tsStorage, forceDirty, currentFiles, filter, fsCache);
}
}
}
else { // is file
if (rootIndex.isFileAccepted(file, rd) && (filter == null || filter.accept(file))) {
boolean markDirty = forceDirty;
if (!markDirty) {
markDirty = tsStorage.getStamp(file, rd.getTarget()) != FileSystemUtil.lastModified(file);
}
if (markDirty) {
// if it is full project rebuild, all storages are already completely cleared;
// so passing null because there is no need to access the storage to clear non-existing data
final Timestamps marker = context.isProjectRebuild() ? null : tsStorage;
context.getProjectDescriptor().fsState.markDirty(context, round, file, rd, marker, false);
}
if (currentFiles != null) {
currentFiles.add(file);
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:FSOperations.java
示例18: filesDeleted
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
@Override
public void filesDeleted(Collection<String> paths) {
BuildFSState state = myContext.getProjectDescriptor().fsState;
BuildRootIndex rootsIndex = myContext.getProjectDescriptor().getBuildRootIndex();
for (String path : paths) {
File file = new File(FileUtil.toSystemDependentName(path));
Collection<BuildRootDescriptor> descriptors = rootsIndex.findAllParentDescriptors(file, null, myContext);
for (BuildRootDescriptor descriptor : descriptors) {
state.registerDeleted(descriptor.getTarget(), file);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ChainedTargetsBuildListener.java
示例19: buildTarget
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
@Override
protected void buildTarget(@NotNull AndroidResourceCachingBuildTarget target,
@NotNull DirtyFilesHolder<BuildRootDescriptor, AndroidResourceCachingBuildTarget> holder,
@NotNull BuildOutputConsumer outputConsumer,
@NotNull CompileContext context) throws ProjectBuildException, IOException {
if (AndroidJpsUtil.isLightBuild(context) || (!holder.hasDirtyFiles() && !holder.hasRemovedFiles())) {
return;
}
if (!runPngCaching(target, context, outputConsumer)) {
throw new StopBuildException();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AndroidResourceCachingBuilder.java
示例20: buildTarget
import org.jetbrains.jps.builders.BuildRootDescriptor; //导入依赖的package包/类
@Override
protected void buildTarget(@NotNull AndroidLibraryPackagingTarget target,
@NotNull DirtyFilesHolder<BuildRootDescriptor, AndroidLibraryPackagingTarget> holder,
@NotNull BuildOutputConsumer outputConsumer,
@NotNull CompileContext context) throws ProjectBuildException, IOException {
if (!holder.hasDirtyFiles() && !holder.hasRemovedFiles()) {
return;
}
assert !AndroidJpsUtil.isLightBuild(context);
if (!doBuild(context, target.getModule(), outputConsumer)) {
throw new StopBuildException();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AndroidLibraryPackagingBuilder.java
注:本文中的org.jetbrains.jps.builders.BuildRootDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论