Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bfairservice-gt committed Nov 9, 2021
1 parent ce4b534 commit c25a21c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
1 change: 0 additions & 1 deletion .ci/Dockerfile.ubuntu18
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ RUN pip3 install --upgrade pip
RUN wget https://www.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
RUN tar xf /tmp/apache-maven-*.tar.gz -C /opt
RUN update-alternatives --install /usr/bin/mvn mvn /opt/apache-maven-3.6.3/bin/mvn 363

41 changes: 16 additions & 25 deletions java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#

# ---------------------------------------------------------------------------
# Get protobuf version to DL from maven repository.
# This value is used in pom.xml.in.
# Get protobuf version to DL from maven repository. This value is used in
# pom.xml.in.
# ---------------------------------------------------------------------------

# Use only minor version, patch versions might not be available
Expand All @@ -23,9 +23,7 @@ set(JAVA_PROTOBUF_VERSION
set(GTIRB_JAVA_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src)

# Directory containing the *.class files generated from the *.proto files
set(GTIRB_PROTO_CLASS_DIR
"${GTIRB_JAVA_SOURCE_DIR}/com/grammatech/gtirb/proto"
)
set(GTIRB_PROTO_CLASS_DIR "${GTIRB_JAVA_SOURCE_DIR}/com/grammatech/gtirb/proto")

# Add commands to compile the *.proto files to *.class files
foreach(GTIRB_PROTO_FILE ${GTIRB_PROTO_FILES})
Expand All @@ -35,8 +33,7 @@ foreach(GTIRB_PROTO_FILE ${GTIRB_PROTO_FILES})
)
add_custom_command(
OUTPUT ${GTIRB_PROTO_CLASS_FILE}
COMMAND ${Protobuf_PROTOC_EXECUTABLE}
--java_out=${GTIRB_JAVA_SOURCE_DIR}
COMMAND ${Protobuf_PROTOC_EXECUTABLE} --java_out=${GTIRB_JAVA_SOURCE_DIR}
--proto_path=${GTIRB_PROTO_DIR} ${GTIRB_PROTO_FILE}
)
list(APPEND GTIRB_PROTOBUF_JAVA ${GTIRB_PROTO_CLASS_FILE})
Expand All @@ -46,8 +43,8 @@ endforeach()
# Building the gtirb java API
# ---------------------------------------------------------------------------
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/pom.xml.in
${CMAKE_CURRENT_BINARY_DIR}/pom.xml @ONLY
${CMAKE_CURRENT_SOURCE_DIR}/pom.xml.in ${CMAKE_CURRENT_BINARY_DIR}/pom.xml
@ONLY
)

file(
Expand Down Expand Up @@ -121,20 +118,19 @@ set(GTIRB_API_JAVAS

foreach(GTIRB_API_JAVA ${GTIRB_API_JAVAS})
list(
APPEND
GTIRB_API_SOURCES
${GTIRB_JAVA_SOURCE_DIR}/com/grammatech/gtirb/${GTIRB_API_JAVA}.java
APPEND GTIRB_API_SOURCES
${GTIRB_JAVA_SOURCE_DIR}/com/grammatech/gtirb/${GTIRB_API_JAVA}.java
)
endforeach()

set(GTIRB_JAVA_API_VERSION
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
)
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
)
set(GTIRB_JAVA_API_JARS
"gtirb_api-${GTIRB_JAVA_API_VERSION}.jar"
"gtirb_api-${GTIRB_JAVA_API_VERSION}-sources.jar"
"gtirb_api-${GTIRB_JAVA_API_VERSION}-javadoc.jar"
)
"gtirb_api-${GTIRB_JAVA_API_VERSION}.jar"
"gtirb_api-${GTIRB_JAVA_API_VERSION}-sources.jar"
"gtirb_api-${GTIRB_JAVA_API_VERSION}-javadoc.jar"
)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/target/${GTIRB_JAVA_API_JARS}
Expand All @@ -148,12 +144,10 @@ add_custom_target(
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/target/${GTIRB_JAVA_API_JARS}
)


# ---------------------------------------------------------------------------
# Building the test code
# ---------------------------------------------------------------------------


if(GTIRB_ENABLE_TESTS)
if(WIN32)
set(DIR_SEP "\;")
Expand All @@ -162,11 +156,8 @@ if(GTIRB_ENABLE_TESTS)
endif()

execute_process(
COMMAND mvn
-q exec:exec
-Dexec.classpathScope=compile
-Dexec.executable=echo
-Dexec.args=%classpath
COMMAND mvn -q exec:exec -Dexec.classpathScope=compile
-Dexec.executable=echo -Dexec.args=%classpath
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
OUTPUT_VARIABLE JAR_FILE_LIST
)
Expand Down
4 changes: 2 additions & 2 deletions java/com/grammatech/gtirb/AuxDataSerialization.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ public ParsedProduct parse(List<String> tokens,
* {@code
* >> _parse_type('foo')
* 'foo', ())
*
*
* >>> _parse_type('foo<bar>')
* ('foo', (('bar',()),))
*
*
* >>> _parse_type('foo<bar<baz>>')
* ('foo', (('bar', (('baz', ()),)),))
* }
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<project>
<modelVersion>4.0.0</modelVersion>

<groupId>com.grammatech.gtirb</groupId>
<artifactId>gtirb_api</artifactId>
<version>@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@</version>
Expand Down

0 comments on commit c25a21c

Please sign in to comment.