Skip to content

Commit

Permalink
Merge pull request #3 from borisf/version-and-command-line
Browse files Browse the repository at this point in the history
Version and command line
  • Loading branch information
borisf committed Jul 19, 2017
2 parents e4143b2 + fa919cd commit 863ca12
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

![alt text](https://github.com/borisf/classyshark-bytecode-viewer/blob/master/img/CS%20Viewer.png)

## Download & Run
To run, grab the [latest JAR](https://github.com/borisf/classyshark-bytecode-viewer/releases)
and run `java -jar ClassySharkBytecodeViewer.jar`. Optionally you can add a class file to open.

## Why
Instantaneously assess performance impact of my Kotlin code on a [class](https://en.wikipedia.org/wiki/Java_class_file) level.

Expand Down
Binary file modified img/CS Viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions src/ClassySharkBytecodeViewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ constructor() : JFrame() {

object IntroTextHolder {
@JvmStatic val INTRO_TEXT = "\n\n\n\n\n\n\n\n\n\n" +
" Drag your class file over here ....\n"
" Drag your class file over here ....\n" +
"\n\n\n\n\n ClassyShark ByteCode Viewer ver." +
Version.MAJOR + "." + Version.MINOR
}

init {
Expand Down Expand Up @@ -168,8 +170,15 @@ constructor() : JFrame() {
@JvmStatic fun main(args: Array<String>) {
SwingUtilities.invokeLater {
try {
val csbv = ClassySharkBytecodeViewer()
csbv.isVisible = true
val bytecodeViewer = ClassySharkBytecodeViewer()

if (args.size == 1) {
bytecodeViewer.onFileDragged(File(args[0]))
} else if (args.size > 1) {
System.out.println("Usage: java -jar ClassySharkBytecodeViewer.jar <path to .class file>")
}

bytecodeViewer.isVisible = true
} catch (e: Exception) {
e.printStackTrace()
}
Expand Down
7 changes: 7 additions & 0 deletions src/Version.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This class holds the current ClassySharkBytecodeViewer version
*/
object Version {
val MAJOR = 5
val MINOR = 0
}

0 comments on commit 863ca12

Please sign in to comment.