Skip to content

Commit

Permalink
don't call kernel.ide stuff from headless code
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdu committed Nov 18, 2014
1 parent 2146b91 commit 6dff42e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
16 changes: 8 additions & 8 deletions org.erlide.backend/src/org/erlide/backend/internal/Backend.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/*******************************************************************************
* Copyright (c) 2009 Vlad Dumitrescu and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available
* at http://www.eclipse.org/legal/epl-v10.html
* Copyright (c) 2009 Vlad Dumitrescu and others. All rights reserved. This program and
* the accompanying materials are made available under the terms of the Eclipse Public
* License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Vlad Dumitrescu
* Contributors: Vlad Dumitrescu
*******************************************************************************/
package org.erlide.backend.internal;

Expand Down Expand Up @@ -103,7 +101,9 @@ protected boolean startErlideApps(final OtpErlangPid jRex, final boolean watch)
switch (data.getContext()) {
case IDE:
site.call("erlide_builder_app", "init", "");
site.call("erlide_ide_app", "init", "");
if (!SystemConfiguration.isHeadless()) {
site.call("erlide_ide_app", "init", "");
}
break;
default:
}
Expand Down
18 changes: 11 additions & 7 deletions org.erlide.core/src/org/erlide/core/ErlangCore.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* Copyright (c) 2000, 2004 IBM Corporation and others. All rights reserved. This program
* and the accompanying materials are made available under the terms of the Eclipse Public
* License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation
* Contributors: IBM Corporation
*******************************************************************************/
package org.erlide.core;

Expand Down Expand Up @@ -64,13 +62,19 @@ public void start() throws CoreException {
final String version = retrieveFeatureVersion();

ErlLogger.info("Starting CORE " + Thread.currentThread());
String dev = "(" + EncodingUtils.getEncoding() + ") ";
String dev = "(" + EncodingUtils.getEncoding() + ")";
if (SystemConfiguration.getInstance().isDeveloper()) {
dev += " developer version ***";
}
if (SystemConfiguration.getInstance().isTest()) {
dev += " test ***";
}
if (SystemConfiguration.isHeadless()) {
dev += " headless";
} else {
dev += " ui";
}

final String versionBanner = "*** starting Erlide v" + version + " *** " + dev;
logger.log(Level.INFO, versionBanner);
featureVersion = version;
Expand Down
6 changes: 6 additions & 0 deletions org.erlide.util/src/org/erlide/util/SystemConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.erlide.util;

import org.eclipse.core.runtime.Platform;

public final class SystemConfiguration {

private static SystemConfiguration instance = new SystemConfiguration();
Expand Down Expand Up @@ -134,4 +136,8 @@ private void setMaxParallelBuilds(final String text) {
public int getMaxParallelBuilds() {
return maxParallelBuilds;
}

public static boolean isHeadless() {
return Platform.getBundle("org.erlide.ui") == null;
}
}

0 comments on commit 6dff42e

Please sign in to comment.