diff --git a/.idea/artifacts/jps_plugins.xml b/.idea/artifacts/jps_plugins.xml
index fee03eee74f7..89f5927429ed 100644
--- a/.idea/artifacts/jps_plugins.xml
+++ b/.idea/artifacts/jps_plugins.xml
@@ -3,9 +3,6 @@
$PROJECT_DIR$/out/artifacts/jps
-
-
-
diff --git a/.idea/artifacts/jps_sources.xml b/.idea/artifacts/jps_sources.xml
index 2cd42352db97..2b7c6fd1e0b7 100644
--- a/.idea/artifacts/jps_sources.xml
+++ b/.idea/artifacts/jps_sources.xml
@@ -6,7 +6,6 @@
-
diff --git a/.idea/libraries/Mac.xml b/.idea/libraries/Mac.xml
index dae0b732f5d2..256d4c9e54a9 100644
--- a/.idea/libraries/Mac.xml
+++ b/.idea/libraries/Mac.xml
@@ -1,12 +1,12 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Mocks.xml b/.idea/libraries/Mocks.xml
index ab3be1d54be9..7e4ee7018f4e 100644
--- a/.idea/libraries/Mocks.xml
+++ b/.idea/libraries/Mocks.xml
@@ -6,7 +6,7 @@
-
+
diff --git a/.idea/libraries/tcServiceMessages.xml b/.idea/libraries/tcServiceMessages.xml
index 2f8bf99242e5..e7fb38a05d50 100644
--- a/.idea/libraries/tcServiceMessages.xml
+++ b/.idea/libraries/tcServiceMessages.xml
@@ -1,11 +1,11 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index c95d45fbe908..ce8d7ca005f3 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -9,7 +9,8 @@
-
+
+
@@ -59,9 +60,6 @@
-
-
-
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpElementImpl.java b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpElementImpl.java
index 9b96b95d7b5f..f0befa3c0287 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpElementImpl.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpElementImpl.java
@@ -49,7 +49,7 @@ public abstract class RegExpElementImpl extends ASTWrapperPsiElement implements
}
public String toString() {
- return getClass().getSimpleName() + ": <" + getUnescapedText() + ">";
+ return getClass().getSimpleName() + ": <" + getText() + ">";
}
public void accept(@NotNull PsiElementVisitor visitor) {
diff --git a/build/scripts/layouts.gant b/build/scripts/layouts.gant
index c26409ec2350..6dc01096ba64 100644
--- a/build/scripts/layouts.gant
+++ b/build/scripts/layouts.gant
@@ -364,6 +364,8 @@ public def layoutCommunityPlugins(String home) {
include(name: "**/*.jar")
exclude(name: "**/ddmlib_1.jar")
}
+
+ jar("android_rt.jar") {module("android-rt")}
}
}
}
diff --git a/build/scripts/libLicenses.gant b/build/scripts/libLicenses.gant
index e0fe9f0cfa10..b90f42d3b3b4 100644
--- a/build/scripts/libLicenses.gant
+++ b/build/scripts/libLicenses.gant
@@ -157,6 +157,7 @@ libraryLicense(name: "Axis", libraryName: "axis-1.4", version: "1.4", license: "
libraryLicense(name: "CGLib", libraryName: "CGLIB", version: "2.2.2", license: "Apache", url: "http://cglib.sourceforge.net/", licenseUrl: "http://www.apache.org/foundation/licence-FAQ.html")
libraryLicense(name: "classworlds", libraryName: "classworlds-1.1.jar", version: "1.1", license: "codehaus", url: "http://classworlds.codehaus.org/", licenseUrl: "http://classworlds.codehaus.org/license.html")
libraryLicense(name: "Android SDK Tools", libraryName: "android-sdk-tools", license: "Apache 2.0", url: "http://source.android.com/")
+libraryLicense(name: "Android SDK Tools JPS", libraryName: "android-sdk-tools-jps", license: "Apache 2.0", url: "http://source.android.com/")
libraryLicense(name: "Apache Commons BeanUtils", libraryName: "commons-beanutils.jar", version: "1.6", license: "Apache 2.0", url: "http://commons.apache.org/beanutils/")
libraryLicense(name: "Apache Commons Codec", libraryName: "commons-codec", version: "1.3", license: "Apache 2.0", url: "http://commons.apache.org/codec/", licenseUrl: "http://commons.apache.org/license.html")
libraryLicense(name: "Apache Commons Collections", libraryName: "commons-collections", version: "3.1", license: "Apache 2.0", url: "http://commons.apache.org/collections/", licenseUrl: "http://commons.apache.org/license.html")
@@ -190,9 +191,9 @@ libraryLicense(name: "JavaHelp", version: "2.0_02", license: "included as licens
libraryLicense(name: "JCIP Annotations", libraryName: "jcip", license: "Creative Commons Attribution License", url: "http://www.jcip.net", licenseUrl: "http://creativecommons.org/licenses/by/2.5")
libraryLicense(name: "JDOM", version: "1.1 (with patches by JetBrains)", license: "modified Apache", url: "http://www.jdom.org/", licenseUrl: "http://www.jdom.org/docs/faq.html#a0030")
libraryLicense(name: "jgit-1.1.0", version: "1.1.0.201109151100", license: "EDL/BSD", url: "http://www.eclipse.org/jgit/", licenseUrl: "http://www.eclipse.org/org/documents/edl-v10.php", attachedTo: "git4idea")
-libraryLicense(name: "JGoodies Forms", libraryName: "jgoodies-forms", version: "CVS snapshot as of 5 May 2006", license: "BSD ", url: "http://www.jgoodies.com/freeware/forms/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
-libraryLicense(name: "JGoodies Looks", attachedTo: "platform-impl", version: "2.4.2", license: "BSD ", url: "http://www.jgoodies.com/freeware/looks/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
-libraryLicense(name: "JGoodies Common", attachedTo: "platform-impl", version: "1.2.1", license: "BSD ", url: "http://www.jgoodies.com/freeware/looks/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
+libraryLicense(name: "JGoodies Forms", libraryName: "jgoodies-forms", version: "1.1-preview 2006-05-04 11:55:37", license: "BSD ", url: "http://www.jgoodies.com/freeware/forms/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
+libraryLicense(name: "JGoodies Looks", libraryName: "jgoodies-looks", version: "2.4.2", license: "BSD ", url: "http://www.jgoodies.com/freeware/looks/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
+libraryLicense(name: "JGoodies Common", libraryName: "jgoodies-common", version: "1.2.1", license: "BSD ", url: "http://www.jgoodies.com/freeware/looks/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
libraryLicense(name: "JNA", libraryName: "jna", version: "3.2.4", license: "LGPL 2.1", url: "https://jna.dev.java.net/", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1.php")
libraryLicense(name: "JNA", libraryName: "jna.jar", version: "3.2.7", license: "LGPL 2.1", url: "https://jna.dev.java.net/", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1.php")
libraryLicense(name: "JSch", libraryName: "JSch", version: "0.1.44", license: "BSD", url: "http://www.jcraft.com/jsch/", licenseUrl: "http://www.jcraft.com/jsch/LICENSE.txt")
@@ -238,4 +239,4 @@ libraryLicense(name: "Kryo", libraryName: "Kryo", version: "1.04", license: "New
jetbrainsLibrary("JPS")
jetbrainsLibrary("Maven Embedder")
jetbrainsLibrary("tcServiceMessages")
-jetbrainsLibrary("optimizedFileManager.jar")
\ No newline at end of file
+jetbrainsLibrary("optimizedFileManager.jar")
diff --git a/community-resources/src/idea/IdeaApplicationInfo.xml b/community-resources/src/idea/IdeaApplicationInfo.xml
index 1e8dbaf004d0..6127d59b9959 100644
--- a/community-resources/src/idea/IdeaApplicationInfo.xml
+++ b/community-resources/src/idea/IdeaApplicationInfo.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java b/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java
index b207b8d4a5e2..ffbcdd9586d9 100644
--- a/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java
+++ b/java/compiler/impl/src/com/intellij/compiler/CompileServerManager.java
@@ -17,6 +17,7 @@ package com.intellij.compiler;
import com.intellij.ProjectTopics;
import com.intellij.application.options.PathMacrosImpl;
+import com.intellij.compiler.server.impl.CompileServerClasspathManager;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.process.OSProcessHandler;
@@ -35,9 +36,7 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.project.ProjectManagerAdapter;
-import com.intellij.openapi.projectRoots.JavaSdkType;
-import com.intellij.openapi.projectRoots.ProjectJdkTable;
-import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.openapi.projectRoots.*;
import com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
@@ -45,6 +44,7 @@ import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar;
import com.intellij.openapi.ui.MessageType;
+import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.ShutDownTracker;
@@ -61,6 +61,7 @@ import com.intellij.util.Alarm;
import com.intellij.util.concurrency.Semaphore;
import com.intellij.util.messages.MessageBusConnection;
import com.intellij.util.net.NetUtils;
+import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.api.*;
@@ -99,6 +100,7 @@ public class CompileServerManager implements ApplicationComponent{
private final ProjectManager myProjectManager;
private static final int MAKE_TRIGGER_DELAY = 5 * 1000 /*5 seconds*/;
private final Map myAutomakeFutures = new HashMap();
+ private final CompileServerClasspathManager myClasspathManager = new CompileServerClasspathManager();
public CompileServerManager(final ProjectManager projectManager) {
myProjectManager = projectManager;
@@ -271,9 +273,8 @@ public class CompileServerManager implements ApplicationComponent{
if (!config.useCompileServer() || !config.MAKE_PROJECT_ON_SAVE) {
continue;
}
- final RequestFuture future = submitCompilationTask(
- project, false, true, Collections.emptyList(), Collections.emptyList(), new AutoMakeResponseHandler(project)
- );
+ final RequestFuture future = submitCompilationTask(project, false, true, Collections.emptyList(), Collections.emptyList(),
+ Collections.emptyList(), new AutoMakeResponseHandler(project));
if (future != null) {
futures.add(future);
synchronized (myAutomakeFutures) {
@@ -311,7 +312,9 @@ public class CompileServerManager implements ApplicationComponent{
}
@Nullable
- public RequestFuture submitCompilationTask(final Project project, final boolean isRebuild, final boolean isMake, final Collection modules, final Collection paths, final JpsServerResponseHandler handler) {
+ public RequestFuture submitCompilationTask(final Project project, final boolean isRebuild, final boolean isMake,
+ final Collection modules, final Collection artifacts,
+ final Collection paths, final JpsServerResponseHandler handler) {
final String projectId = project.getLocation();
final Ref futureRef = new Ref(null);
final RunnableFuture future = myTaskExecutor.submit(new Runnable() {
@@ -321,7 +324,7 @@ public class CompileServerManager implements ApplicationComponent{
if (client != null) {
final RequestFuture requestFuture = isRebuild ?
client.sendRebuildRequest(projectId, handler) :
- client.sendCompileRequest(isMake, projectId, modules, paths, handler);
+ client.sendCompileRequest(isMake, projectId, modules, artifacts, paths, handler);
futureRef.set(requestFuture);
}
else {
@@ -461,8 +464,9 @@ public class CompileServerManager implements ApplicationComponent{
private static RequestFuture sendSetupRequest(final @NotNull CompileServerClient client) throws Exception {
final Map data = new HashMap();
- // need this for tests and when this macro is missing from PathMacros registry
- data.put(PathMacrosImpl.APPLICATION_HOME_MACRO_NAME, FileUtil.toSystemIndependentName(PathManager.getHomePath()));
+ for (Map.Entry entry : PathMacrosImpl.getGlobalSystemMacros().entrySet()) {
+ data.put(entry.getKey(), FileUtil.toSystemIndependentName(entry.getValue()));
+ }
final PathMacros pathVars = PathMacros.getInstance();
for (String name : pathVars.getAllMacroNames()) {
@@ -487,8 +491,19 @@ public class CompileServerManager implements ApplicationComponent{
if (homePath == null) {
continue;
}
+ final SdkAdditionalData data = sdk.getSdkAdditionalData();
+ final String additionalDataXml;
+ final SdkType sdkType = sdk.getSdkType();
+ if (data == null) {
+ additionalDataXml = null;
+ }
+ else {
+ final Element element = new Element("additional");
+ sdkType.saveAdditionalData(data, element);
+ additionalDataXml = JDOMUtil.writeElement(element, "\n");
+ }
final List paths = convertToLocalPaths(sdk.getRootProvider().getFiles(OrderRootType.CLASSES));
- globals.add(new SdkLibrary(name, homePath, paths));
+ globals.add(new SdkLibrary(name, sdkType.getName(), homePath, paths, additionalDataXml));
}
}
@@ -582,6 +597,7 @@ public class CompileServerManager implements ApplicationComponent{
cmdLine.addParameter("-classpath");
final List cp = ClasspathBootstrap.getCompileServerApplicationClasspath();
+ cp.addAll(myClasspathManager.getCompileServerPluginsClasspath());
cmdLine.addParameter(classpathToString(cp));
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
index 87198ba9d5e7..857d42b0632b 100644
--- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
+++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
@@ -144,8 +144,6 @@ public class CompileDriver {
}
};
- private OutputPathFinder myOutputFinder; // need this for updating zip archives (experimental feature)
-
private Set myAllOutputDirectories;
private static final long ONE_MINUTE_MS = 60L /*sec*/ * 1000L /*millisec*/;
@@ -414,19 +412,25 @@ public class CompileDriver {
}
@Nullable
- private RequestFuture compileOnServer(final CompileContextImpl compileContext, Collection modules, final Collection paths, @Nullable final CompileStatusNotification callback)
+ private RequestFuture compileOnServer(final @NotNull CompileContextImpl compileContext, @NotNull Collection modules, @NotNull Collection artifacts,
+ final @NotNull Collection paths, @Nullable final CompileStatusNotification callback)
throws Exception {
Collection moduleNames = Collections.emptyList();
- if (modules != null && modules.size() > 0) {
+ if (modules.size() > 0) {
moduleNames = new ArrayList(modules.size());
for (Module module : modules) {
moduleNames.add(module.getName());
}
}
+ List artifactNames = new ArrayList();
+ for (Artifact artifact : artifacts) {
+ artifactNames.add(artifact.getName());
+ }
+
final CompileServerManager csManager = CompileServerManager.getInstance();
final MessageBus messageBus = myProject.getMessageBus();
csManager.cancelAutoMakeTasks(myProject);
- return csManager.submitCompilationTask(myProject, compileContext.isRebuild(), compileContext.isMake(), moduleNames, paths, new JpsServerResponseHandler() {
+ return csManager.submitCompilationTask(myProject, compileContext.isRebuild(), compileContext.isMake(), moduleNames, artifactNames, paths, new JpsServerResponseHandler() {
@Override
public void handleCompileMessage(JpsRemoteProto.Message.Response.CompileMessage compilerMessage) {
@@ -584,7 +588,8 @@ public class CompileDriver {
}
final Collection paths = fetchFiles(compileContext);
final List modules = paths.isEmpty()? Arrays.asList(compileContext.getCompileScope().getAffectedModules()) : Collections.emptyList();
- final RequestFuture future = compileOnServer(compileContext, modules, paths, callback);
+ final Set artifacts = ArtifactCompileScope.getArtifactsToBuild(myProject, compileContext.getCompileScope(), true);
+ final RequestFuture future = compileOnServer(compileContext, modules, artifacts, paths, callback);
if (future != null) {
try {
startCancelWatcher(indicator, future);
@@ -658,6 +663,7 @@ public class CompileDriver {
finish - start
);
CompilerCacheManager.getInstance(myProject).flushCaches();
+ FileUtil.delete(CompilerPaths.getRebuildMarkerFile(myProject));
}
}
};
@@ -748,8 +754,6 @@ public class CompileDriver {
}
myAllOutputDirectories = getAllOutputDirectories(compileContext);
- // need this for updating zip archives experiment, uncomment if the feature is turned on
- //myOutputFinder = new OutputPathFinder(myAllOutputDirectories);
status = doCompile(compileContext, isRebuild, forceCompile, false);
}
catch (Throwable ex) {
@@ -820,6 +824,10 @@ public class CompileDriver {
}
private void checkCachesVersion(final CompileContextImpl compileContext, final long currentVFSTimestamp) {
+ if (CompilerPaths.getRebuildMarkerFile(compileContext.getProject()).exists()) {
+ compileContext.requestRebuildNextTime("Compiler caches are out of date, project rebuild is required");
+ return;
+ }
final CompileStatus compileStatus = readStatus();
if (compileStatus == null) {
compileContext.requestRebuildNextTime(CompilerBundle.message("error.compiler.caches.corrupted"));
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/TranslatingCompilerFilesMonitor.java b/java/compiler/impl/src/com/intellij/compiler/impl/TranslatingCompilerFilesMonitor.java
index 7f12839af0b4..f6c37ea4b2b9 100644
--- a/java/compiler/impl/src/com/intellij/compiler/impl/TranslatingCompilerFilesMonitor.java
+++ b/java/compiler/impl/src/com/intellij/compiler/impl/TranslatingCompilerFilesMonitor.java
@@ -19,6 +19,7 @@ import com.intellij.ProjectTopics;
import com.intellij.compiler.CompileServerManager;
import com.intellij.compiler.CompilerConfiguration;
import com.intellij.compiler.CompilerIOUtil;
+import com.intellij.compiler.CompilerWorkspaceConfiguration;
import com.intellij.compiler.make.MakeUtil;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.Application;
@@ -82,12 +83,16 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
public static boolean ourDebugMode = false;
@NonNls
private static final String PATHS_TO_DELETE_FILENAME = "paths_to_delete.dat";
+ private static final String SUSPENDED_PROJECTS_FILENAME = "suspended.dat";
private static final String OUTPUT_ROOTS_FILENAME = "output_roots.dat";
private static final FileAttribute ourSourceFileAttribute = new FileAttribute("_make_source_file_info_", 3);
private static final FileAttribute ourOutputFileAttribute = new FileAttribute("_make_output_file_info_", 3);
private static final Key