forked from GrammaTech/gtirb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed the Node UUID lookup map to actually get populated. * Added more constructors to allow greater flexibility in populating new GTIRB data. * Fixed ByteInterval handling of things like .bss, so that the size of a ByteInterval doesn't need to match the length of its contents. * Fixed misleading Symbol method names. * Added a generic version of Node.getByUuid * Added Gradle settings to allow easy import into Java IDEs like IntelliJ, Eclipse, etc. * Organized AuxData serialization classes into a subdirectory * More type-safe AuxData type string parsing
- Loading branch information
Jennifer Berringer
committed
Dec 16, 2021
1 parent
7e779c6
commit 3fa58fc
Showing
36 changed files
with
717 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.idea | ||
.gradle | ||
gradle | ||
gradlew | ||
gradlew.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* Gradle build for GTIRB Java API | ||
* | ||
* NOTE: The supported build system is CMake. | ||
* This Gradle build exists as a convenience to make it easier to develop in | ||
* IDEs like IntelliJ, Eclipse, etc. | ||
* | ||
* Before running Gradle, generate Protobuf Java sources: | ||
* $ protoc --java_out=. --proto-path=proto ../proto/*.proto | ||
* | ||
* After IntelliJ import, it may help to add to its .idea/gradle.xml: | ||
* <option name="resolveModulePerSourceSet" value="false" /> | ||
*/ | ||
apply plugin: 'java' | ||
|
||
repositories { mavenCentral() } | ||
|
||
sourceSets { | ||
main.java.srcDirs = ['.', "${buildDir}/generated/java"] | ||
} | ||
|
||
dependencies { | ||
compile 'com.google.protobuf:protobuf-java:3.11.1' | ||
} | ||
|
||
compileJava { | ||
doFirst { | ||
def pkg = "com/grammatech/gtirb" | ||
|
||
// Read the version information from version.txt | ||
def versionTxt = new File("${projectDir}/../version.txt") | ||
def versionMap = [:] | ||
versionTxt.eachLine { String line -> | ||
def (name, value) = line.split() | ||
versionMap[name] = value | ||
} | ||
|
||
// This version number appears in the output JAR filename | ||
version = versionMap["VERSION_MAJOR"] + "." + | ||
versionMap["VERSION_MINOR"] + "." + versionMap["VERSION_PATCH"] | ||
|
||
// Generate Version.java based on the Version.java.in template | ||
ant.mkdir(dir: "${buildDir}/generated/java/${pkg}/gtirb") | ||
def newVersion = new File("${buildDir}/generated/java/${pkg}/Version.java") | ||
def templateVersion = new File("${projectDir}/Version.java.in") | ||
newVersion.withWriter { def writer -> | ||
templateVersion.eachLine { def line -> | ||
def newLine = line | ||
.replace("@PROJECT_VERSION_MAJOR@", versionMap["VERSION_MAJOR"]) | ||
.replace("@PROJECT_VERSION_MINOR@", versionMap["VERSION_MINOR"]) | ||
.replace("@PROJECT_VERSION_PATCH@", versionMap["VERSION_PATCH"]) | ||
.replace("@GTIRB_PROTOBUF_VERSION@", versionMap["VERSION_PROTOBUF"]) | ||
writer.write(newLine + "\n"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.