Skip to content

Commit

Permalink
Export WireIO version as a system property
Browse files Browse the repository at this point in the history
  • Loading branch information
jbachorik committed Dec 6, 2020
1 parent 401e692 commit ecbb3ab
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 2 deletions.
3 changes: 3 additions & 0 deletions btrace-agent/src/main/java/org/openjdk/btrace/agent/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import org.openjdk.btrace.core.comm.ErrorCommand;
import org.openjdk.btrace.core.comm.InstrumentCommand;
import org.openjdk.btrace.core.comm.StatusCommand;
import org.openjdk.btrace.core.comm.WireIO;
import org.openjdk.btrace.instr.BTraceTransformer;
import org.openjdk.btrace.instr.Constants;
import org.openjdk.btrace.runtime.BTraceRuntimes;
Expand Down Expand Up @@ -836,6 +837,8 @@ private static void startServer() {
debugPrint("starting server at " + port);
}
System.setProperty("btrace.port", String.valueOf(port));
System.setProperty("btrace.wireio", String.valueOf(WireIO.VERSION));

String scriptOutputFile = settings.getOutputFile();
if (scriptOutputFile != null && scriptOutputFile.length() > 0) {
System.setProperty("btrace.output", scriptOutputFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ static Collection<String> listVms() {
String mainClass = MonitoredVmUtil.mainClass(mvm, false);

vms.add(
"["
"("
+ (hasBTraceServer(vmPid) ? "+" : "-")
+ "] "
+ ") "
+ vmPid
+ " "
+ mainClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.ObjectOutput;
import java.io.PrintWriter;

/** @since WireIO v.1 */
public final class DisconnectCommand extends Command implements PrintableCommand {
private String probeId = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Collection;
import java.util.List;

/** @since WireIO v.1 */
public class ListProbesCommand extends Command implements PrintableCommand {
private final List<String> probes = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;

/** @since WireIO v.1 */
public class ReconnectCommand extends Command {
public static final int STATUS_FLAG = 8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.io.ObjectOutput;

public class WireIO {
public static final int VERSION = 1;

private WireIO() {}

Expand Down
26 changes: 26 additions & 0 deletions btrace-ui/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plugins {
id 'net.nemerosa.versioning' version '2.6.1'
}

sourceCompatibility = '11'
targetCompatibility = '11'

dependencies {
compile project(':btrace-core')
compile project(':btrace-compiler')
compile project(':btrace-instr')
}

jar {
manifest {
attributes(
'Built-By' : System.properties['user.name'],
'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Revision' : versioning.info.commit,
'Created-By' : "Gradle ${gradle.gradleVersion}",
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
'Main-Class' : "org.openjdk.btrace.client.Main"
)
}
}

0 comments on commit ecbb3ab

Please sign in to comment.