Skip to content

Commit 13ca0fb

Browse files
committed
v0.32.0
2 parents ea18ef4 + dfed7a0 commit 13ca0fb

File tree

57 files changed

+717
-567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+717
-567
lines changed

CHANGES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
List of user visible changes between 0.31.0 and 0.32.0 (20160414)
2+
3+
f065b88 #261 - search installed runtimes in $PATH too
4+
e1424fb append RpcMonitor stats to erlide.log instead of a separate file
5+
db786e5 make location of erlide log configurable
6+
454e9a0 output only warnings and errors in the console
7+
f8c4860 #263 - Add action to clear all model caches
8+
19
List of user visible changes between 0.30.1 and 0.31.0 (20160404)
210

311
334684b indentation: add 'indent width' parameter

Jenkinsfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
node {
2+
wrap([$class: 'TimestamperBuildWrapper']) {
3+
stage 'Checkout'
4+
//checkout scm
5+
//currentBuild.setName("${env.GIT_REVISION}__${env.BUILD_NUMBER}")
6+
7+
stage 'Compile'
8+
wrap([$class: 'Xvfb', additionalOptions: '', assignedLabels: '', displayNameOffset: 1, installationName: 'xvfb', screen: '1024x768x24']) {
9+
sh "bundle install"
10+
sh "rake -f org.erlide.releng/Rakefile build_help run_tests"
11+
}
12+
13+
stage 'Analyze'
14+
step([$class: 'WarningsPublisher', canComputeNew: false, canResolveRelativePaths: false, consoleParsers: [[parserName: 'Buckminster']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: ''])
15+
16+
step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME,XXX', low: '', normal: 'TODO', pattern: '**/*.java,**/*.?rl,**/*.xtend', unHealthy: ''])
17+
18+
step([$class: 'AnalysisPublisher', canComputeNew: false, defaultEncoding: '', healthy: '', unHealthy: ''])
19+
20+
step([$class: 'JUnitResultArchiver', testResults: '**/junit.xml,**/.eunit/*.xml'])
21+
22+
// locks
23+
24+
// jacoco
25+
26+
stage 'Publish'
27+
//step([$class: 'ArtifactArchiver', artifacts: 'buildroot/**/*.*', fingerprint: true])
28+
}
29+
}
30+

org.erlide.backend.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: Backend Tests
44
Bundle-SymbolicName: org.erlide.backend.tests
5-
Bundle-Version: 0.24.1.qualifier
5+
Bundle-Version: 0.32.0.qualifier
66
Bundle-Vendor: erlide.org
77
Fragment-Host: org.erlide.backend;bundle-version="0.19.0"
88
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

org.erlide.backend/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.erlide.backend;singleton:=true
5-
Bundle-Version: 0.24.19.qualifier
5+
Bundle-Version: 0.32.0.qualifier
66
Bundle-ClassPath: .
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

org.erlide.backend/src/org/erlide/backend/debug/model/ErlangDebugTarget.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@
2727
import org.eclipse.core.runtime.CoreException;
2828
import org.eclipse.core.runtime.IConfigurationElement;
2929
import org.eclipse.core.runtime.IContributor;
30-
import org.eclipse.core.runtime.IExtensionRegistry;
3130
import org.eclipse.core.runtime.IPath;
3231
import org.eclipse.core.runtime.Path;
3332
import org.eclipse.core.runtime.Platform;
34-
import org.eclipse.core.runtime.RegistryFactory;
3533
import org.eclipse.debug.core.DebugException;
3634
import org.eclipse.debug.core.DebugPlugin;
3735
import org.eclipse.debug.core.ILaunch;
@@ -41,13 +39,13 @@
4139
import org.eclipse.debug.core.model.IProcess;
4240
import org.eclipse.debug.core.model.IThread;
4341
import org.eclipse.jdt.annotation.NonNull;
42+
import org.erlide.backend.BackendUtils;
4443
import org.erlide.backend.api.IBackend;
4544
import org.erlide.backend.debug.BeamUtil;
4645
import org.erlide.backend.debug.DebuggerEventDaemon;
4746
import org.erlide.backend.debug.ErlangLineBreakpoint;
4847
import org.erlide.backend.debug.ErlideDebug;
4948
import org.erlide.backend.debug.IErlangDebugNode;
50-
import org.erlide.backend.internal.BackendActivator;
5149
import org.erlide.engine.ErlangEngine;
5250
import org.erlide.engine.model.IErlModel;
5351
import org.erlide.engine.model.root.ErlangProjectProperties;
@@ -56,8 +54,8 @@
5654
import org.erlide.util.IDisposable;
5755
import org.erlide.util.erlang.ErlUtils;
5856
import org.erlide.util.erlang.OtpErlang;
59-
import org.erlide.util.erlang.SignatureException;
6057
import org.erlide.util.erlang.OtpParserException;
58+
import org.erlide.util.erlang.SignatureException;
6159
import org.osgi.framework.Bundle;
6260

6361
import com.ericsson.otp.erlang.OtpErlangAtom;
@@ -499,11 +497,10 @@ private void distributeDebuggerCode() {
499497

500498
final List<OtpErlangTuple> modules = new ArrayList<OtpErlangTuple>(
501499
debuggerModules.size());
500+
final String ver = backend.getRuntime().getVersion().asMajor().toString()
501+
.toLowerCase();
502502
for (final String module : debuggerModules) {
503-
final String ver = backend.getRuntime().getVersion().asMajor().toString()
504-
.toLowerCase();
505-
final String bundleName = "org.erlide.kernel.debugger." + ver;
506-
OtpErlangBinary b = getDebuggerBeam(module, bundleName);
503+
OtpErlangBinary b = getDebuggerBeam(module, "org.erlide.kernel.debugger.otp");
507504
if (b == null) {
508505
b = getDebuggerBeam(module, "org.erlide.kernel.debugger");
509506
}
@@ -513,7 +510,7 @@ private void distributeDebuggerCode() {
513510
filename, b);
514511
modules.add(t);
515512
} else {
516-
ErlLogger.warn("Could not find debugger module %s", module);
513+
ErlLogger.warn("Could not find debugger module %s (%s)", module, ver);
517514
}
518515
}
519516
ErlideDebug.distributeDebuggerCode(backend.getOtpRpc(), modules);
@@ -532,10 +529,8 @@ private OtpErlangBinary getDebuggerBeam(final String module,
532529
final String beamname = module + ".beam";
533530
final Bundle bundle = Platform.getBundle(bundleName);
534531

535-
final IExtensionRegistry reg = RegistryFactory.getRegistry();
536-
final IConfigurationElement[] els = reg
537-
.getConfigurationElementsFor(BackendActivator.PLUGIN_ID, "codepath");
538-
532+
final IConfigurationElement[] els = BackendUtils
533+
.getCodepathConfigurationElements();
539534
for (final IConfigurationElement el : els) {
540535
final IContributor c = el.getContributor();
541536
final String name = c.getName();
@@ -588,26 +583,30 @@ private List<String> getDebuggerModules() {
588583
ErlLogger.warn("debugger bundle was not found...");
589584
return new ArrayList<String>();
590585
}
591-
final List<String> dbg_modules = getModulesFromBundle(debugger);
586+
final List<String> dbg_modules = getModulesFromBundle(debugger, null);
592587

593-
final String ver = backend.getRuntime().getVersion().asMajor().toString()
594-
.toLowerCase();
595-
final Bundle debugger_otp = Platform
596-
.getBundle("org.erlide.kernel.debugger." + ver);
588+
final Bundle debugger_otp = Platform.getBundle("org.erlide.kernel.debugger.otp");
597589
if (debugger_otp == null) {
598-
ErlLogger.warn("debugger %s bundle was not found...", ver);
590+
ErlLogger.error("debugger bundle was not found!");
599591
return dbg_modules;
600592
}
601-
final List<String> dbg_otp_modules = getModulesFromBundle(debugger_otp);
593+
final String ver = backend.getRuntime().getVersion().asMajor().toString()
594+
.toLowerCase();
595+
final List<String> dbg_otp_modules = getModulesFromBundle(debugger_otp, ver);
602596

603597
dbg_modules.addAll(dbg_otp_modules);
604598
return dbg_modules;
605599
}
606600

607-
private List<String> getModulesFromBundle(final Bundle bundle) {
601+
private List<String> getModulesFromBundle(final Bundle bundle, final String ver) {
608602
final List<String> modules = Lists.newArrayList();
603+
final String path = ver == null ? "/debugger" : "/debugger/" + ver;
609604
@SuppressWarnings("rawtypes")
610-
final Enumeration beams = bundle.findEntries("/ebin", "*.beam", false);
605+
final Enumeration beams = bundle.findEntries(path, "*.beam", false);
606+
if (beams == null) {
607+
ErlLogger.error("No beams found in %s!", bundle);
608+
return modules;
609+
}
611610
while (beams.hasMoreElements()) {
612611
final URL beam = (URL) beams.nextElement();
613612
modules.add(new Path(beam.getPath()).removeFileExtension().lastSegment());

org.erlide.branding/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: erlide - Erlang language tools
44
Bundle-SymbolicName: org.erlide.branding;singleton:=true
5-
Bundle-Version: 0.30.0.qualifier
5+
Bundle-Version: 0.32.0.qualifier
66
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
77
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
88
org.eclipse.ui.intro.universal;bundle-version="3.2.500",

org.erlide.core.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: erlide core Tests Fragment
44
Bundle-SymbolicName: org.erlide.core.tests;singleton:=true
5-
Bundle-Version: 0.24.9.qualifier
5+
Bundle-Version: 0.32.0.qualifier
66
Bundle-Vendor: erlide.org
77
Fragment-Host: org.erlide.core;bundle-version="0.14.0"
88
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

org.erlide.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.erlide.core; singleton:=true
5-
Bundle-Version: 0.24.15.qualifier
5+
Bundle-Version: 0.32.0.qualifier
66
Bundle-Activator: org.erlide.core.ErlangPlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

org.erlide.core/src/org/erlide/core/ErlangCore.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
*******************************************************************************/
99
package org.erlide.core;
1010

11-
import java.text.SimpleDateFormat;
12-
import java.util.Date;
1311
import java.util.logging.Level;
1412

1513
import org.eclipse.core.resources.ISaveContext;
@@ -48,14 +46,14 @@ public final class ErlangCore {
4846
private final ErlangCoreLogger logger;
4947

5048
public ErlangCore(final Plugin plugin, final IWorkspace workspace,
51-
final IExtensionRegistry extensionRegistry, final String logDir,
49+
final IExtensionRegistry extensionRegistry,
5250
final ErlangDebugOptionsManager erlangDebugOptionsManager) {
5351
this.plugin = plugin;
5452
this.workspace = workspace;
5553
this.extensionRegistry = extensionRegistry;
5654
this.erlangDebugOptionsManager = erlangDebugOptionsManager;
5755
featureVersion = "?";
58-
logger = new ErlangCoreLogger(plugin, logDir);
56+
logger = new ErlangCoreLogger(plugin);
5957
}
6058

6159
public void start() throws CoreException {
@@ -91,10 +89,9 @@ public void stop() {
9189
final String location = ResourcesPlugin.getWorkspace().getRoot().getLocation()
9290
.toPortableString();
9391

94-
final String dateNow = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
95-
9692
RpcMonitor.cleanupOldLogs(location, "rpc_monitor");
97-
RpcMonitor.dump(location + "/rpc_monitor-" + dateNow + ".dump");
93+
ErlLogger.getInstance().dispose();
94+
RpcMonitor.dump(ErlLogger.getInstance().getLogFile());
9895
}
9996

10097
public IWorkspace getWorkspace() {
@@ -128,8 +125,8 @@ public void rollback(final ISaveContext context1) {
128125
@Override
129126
public void saving(final ISaveContext context1) throws CoreException {
130127
try {
131-
InstanceScope.INSTANCE.getNode(
132-
plugin.getBundle().getSymbolicName()).flush();
128+
InstanceScope.INSTANCE
129+
.getNode(plugin.getBundle().getSymbolicName()).flush();
133130
} catch (final BackingStoreException e) {
134131
// ignore
135132
}
@@ -157,8 +154,8 @@ public boolean isTracing(final String traceOption) {
157154
}
158155
final String globalTraceValue = Platform
159156
.getDebugOption(ERLIDE_GLOBAL_TRACE_OPTION);
160-
final String value = Platform.getDebugOption(ERLIDE_GLOBAL_TRACE_OPTION + "/"
161-
+ traceOption);
157+
final String value = Platform
158+
.getDebugOption(ERLIDE_GLOBAL_TRACE_OPTION + "/" + traceOption);
162159
if ("true".equalsIgnoreCase(globalTraceValue) && "true".equalsIgnoreCase(value)) {
163160
return true;
164161
}

org.erlide.core/src/org/erlide/core/ErlangCoreLogger.java

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package org.erlide.core;
22

3+
import java.io.File;
34
import java.util.logging.Level;
45

56
import org.eclipse.core.resources.ResourcesPlugin;
7+
import org.eclipse.core.runtime.IPath;
68
import org.eclipse.core.runtime.IStatus;
79
import org.eclipse.core.runtime.MultiStatus;
10+
import org.eclipse.core.runtime.Path;
811
import org.eclipse.core.runtime.Platform;
912
import org.eclipse.core.runtime.Plugin;
1013
import org.eclipse.core.runtime.Status;
@@ -15,12 +18,12 @@ public class ErlangCoreLogger {
1518
private final Plugin plugin;
1619
private final ErlLogger logger;
1720

18-
public ErlangCoreLogger(final Plugin plugin, final String logDir) {
21+
public ErlangCoreLogger(final Plugin plugin) {
1922
this.plugin = plugin;
2023
logger = ErlLogger.getInstance();
21-
final String dir = getLogDir(logDir);
22-
log(Level.INFO, "Erlide log is in " + dir);
23-
logger.setLogDir(dir);
24+
final String logFile = getLogFile();
25+
log(Level.INFO, "Erlide log is in " + logFile);
26+
logger.setLogFile(logFile);
2427
}
2528

2629
public void debug(final String message) {
@@ -41,9 +44,8 @@ public void log(final IStatus status) {
4144

4245
public void log(final Level lvl, final String status) {
4346
logger.log(lvl, status);
44-
plugin.getLog().log(
45-
new Status(getSeverityFromLevel(lvl), plugin.getBundle()
46-
.getSymbolicName(), status));
47+
plugin.getLog().log(new Status(getSeverityFromLevel(lvl),
48+
plugin.getBundle().getSymbolicName(), status));
4749
}
4850

4951
public void log(final String msg, final Throwable thr) {
@@ -73,18 +75,20 @@ public void logErrorStatus(final String message, final IStatus status) {
7375
log(multi);
7476
}
7577

76-
public static String getLogDir(final String logDir) {
78+
public static String getLogFile() {
7779
final IPreferencesService service = Platform.getPreferencesService();
78-
final String key = "erlide_log_directory";
7980
final String pluginId = ErlangCore.PLUGIN_ID;
80-
final String s = service.getString(pluginId, key, logDir, null);
81-
String dir;
82-
if (s != null) {
83-
dir = s;
81+
final String file = service.getString(pluginId, "log_file", "erlide.log", null);
82+
final IPath path = new Path(file);
83+
String location;
84+
if (!path.isAbsolute()) {
85+
final IPath wroot = ResourcesPlugin.getWorkspace().getRoot().getLocation();
86+
location = wroot.append(file).toPortableString();
8487
} else {
85-
dir = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
88+
location = file;
8689
}
87-
return dir;
90+
new File(location).getParentFile().mkdirs();
91+
return location;
8892
}
8993

9094
private static Level getLevelFromSeverity(final int severity) {

0 commit comments

Comments
 (0)