cleanup: remove useless '@author nik' from javadoc comments
[idea/community.git] / java / compiler / impl / src / com / intellij / packaging / impl / compiler / ArtifactsCompiler.java
1 // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2 package com.intellij.packaging.impl.compiler;
3
4 import com.intellij.openapi.compiler.CompileContext;
5 import com.intellij.openapi.util.Key;
6 import com.intellij.task.ProjectTaskContext;
7 import com.intellij.task.impl.JpsBuildData;
8 import com.intellij.task.impl.JpsProjectTaskRunner;
9 import gnu.trove.THashSet;
10 import org.jetbrains.annotations.NotNull;
11 import org.jetbrains.annotations.Nullable;
12
13 import java.util.Set;
14
15 public class ArtifactsCompiler {
16   private static final Key<Set<String>> WRITTEN_PATHS_KEY = Key.create("artifacts_written_paths");
17
18   public static void addWrittenPaths(final CompileContext context, Set<String> writtenPaths) {
19     Set<String> paths = context.getUserData(WRITTEN_PATHS_KEY);
20     if (paths == null) {
21       paths = new THashSet<>();
22       context.putUserData(WRITTEN_PATHS_KEY, paths);
23     }
24     paths.addAll(writtenPaths);
25   }
26
27   @Nullable
28   public static Set<String> getWrittenPaths(@NotNull CompileContext context) {
29     return context.getUserData(WRITTEN_PATHS_KEY);
30   }
31
32   @Nullable
33   public static Set<String> getWrittenPaths(@NotNull ProjectTaskContext context) {
34     JpsBuildData jpsBuildData = context.getUserData(JpsProjectTaskRunner.JPS_BUILD_DATA_KEY);
35     return jpsBuildData == null ? null : jpsBuildData.getArtifactsWrittenPaths();
36   }
37 }