Skip to content

Commit

Permalink
Remove --javac parameter
Browse files Browse the repository at this point in the history
After switching ContikiMoteType to use
an Arena, this is no longer required.
  • Loading branch information
pjonsson committed Aug 31, 2023
1 parent babf6b3 commit 15230b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ tasks.register('fullJar', Jar) {
run {
// Bad Cooja location detected with gradle run, explicitly pass -cooja.
doFirst {
args += ['--cooja', "$projectDir",
'--javac', javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(javaVersion)
}.get().executablePath]
args += ['--cooja', "$projectDir"]
}
// Connect stdin to make the MSPSim CLI work, except when running in CI.
if (System.getenv('CI') == null) {
Expand Down
2 changes: 1 addition & 1 deletion java/org/contikios/cooja/Cooja.java
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ public static void loadQuickHelp(final Object obj) {
* values when creating a new simulation in the File menu.
*/
public record Config(LogbackColors logColors, boolean vis, String externalToolsConfig,
String logDir, String contikiPath, String coojaPath, String javac) {}
String logDir, String contikiPath, String coojaPath) {}

public record LogbackColors(String error, String warn, String info, String fallback) {}
private record PathIdentifier(String id, String path) {}
Expand Down
18 changes: 1 addition & 17 deletions java/org/contikios/cooja/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ class Main {
@Option(names = "--cooja", paramLabel = "DIR", description = "the Cooja directory")
String coojaPath;

/**
* Option for specifying javac path.
*/
@Option(names = "--javac", paramLabel = "FILE", description = "the javac binary")
String javac;

/**
* Option for specifying external user config file.
*/
Expand Down Expand Up @@ -295,22 +289,12 @@ public static void main(String[] args) {
System.exit(1);
}

if (options.mspSimPlatform == null && options.javac == null) {
System.err.println("Missing required option: '--javac=FILE'");
System.exit(1);
}

if (options.mspSimPlatform == null && !Files.exists(Path.of(options.javac))) {
System.err.println("Java compiler '" + options.javac + "' does not exist");
System.exit(1);
}

if (options.mspSimPlatform == null) { // Start Cooja.
// Use colors that are good on a dark background and readable on a white background.
var colors = new LogbackColors(ANSIConstants.BOLD + "91", "96",
ANSIConstants.GREEN_FG, ANSIConstants.DEFAULT_FG);
var cfg = new Config(colors, options.gui, options.externalUserConfig,
options.logDir, options.contikiPath, options.coojaPath, options.javac);
options.logDir, options.contikiPath, options.coojaPath);
Cooja.go(cfg, simConfigs);
} else { // Start MSPSim.
var config = new ArgumentManager(options.simulationFiles.toArray(new String[0]));
Expand Down

0 comments on commit 15230b6

Please sign in to comment.