forked from diffblue/cbmc
-
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.
Merge pull request diffblue#2426 from peterschrammel/java-models-libr…
…ary-submodule Use submodule to download java-models-library
- Loading branch information
Showing
12 changed files
with
47 additions
and
81 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,3 @@ | ||
[submodule "jbmc/lib/java-models-library"] | ||
path = jbmc/lib/java-models-library | ||
url = https://github.com/diffblue/java-models-library.git |
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 |
---|---|---|
|
@@ -229,6 +229,7 @@ jobs: | |
- ccache -z | ||
- ccache --max-size=1G | ||
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-5' | ||
- git submodule update --init --recursive | ||
- cmake --build build -- -j4 | ||
script: (cd build; ctest -V -L CORE -j2) | ||
|
||
|
@@ -254,6 +255,7 @@ jobs: | |
- ccache -z | ||
- ccache --max-size=1G | ||
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-7' | ||
- git submodule update --init --recursive | ||
- cmake --build build -- -j4 | ||
script: (cd build; ctest -V -L CORE -j2) | ||
|
||
|
@@ -287,6 +289,7 @@ jobs: | |
- ccache -z | ||
- ccache --max-size=1G | ||
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/clang++-6.0' '-DCMAKE_CXX_FLAGS=-Qunused-arguments' | ||
- git submodule update --init --recursive | ||
- cmake --build build -- -j4 | ||
script: (cd build; ctest -V -L CORE -j2) | ||
|
||
|
@@ -305,6 +308,7 @@ jobs: | |
- ccache -z | ||
- ccache --max-size=1G | ||
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_OSX_ARCHITECTURES=x86_64' | ||
- git submodule update --init --recursive | ||
- cmake --build build -- -j4 | ||
script: (cd build; ctest -V -L CORE -j2) | ||
|
||
|
@@ -328,7 +332,7 @@ jobs: | |
name: "diffblue/cbmc" | ||
description: "Travis build of ${TRAVIS_COMMIT}" | ||
notification_email: "[email protected]" | ||
build_command_prepend: "make -C jbmc/src java-models-library-download" | ||
build_command_prepend: "make -C jbmc/src setup-submodules" | ||
build_command_prepend: "make -C src minisat2-download" | ||
build_command: "make -C src -j2; make -C jbmc/src -j2" | ||
branch_pattern: "develop" | ||
|
@@ -349,7 +353,7 @@ jobs: | |
install: | ||
- ccache -z | ||
- ccache --max-size=1G | ||
- make -C jbmc/src java-models-library-download | ||
- make -C jbmc/src setup-submodules | ||
- make -C src minisat2-download | ||
- make -C src/ansi-c library_check | ||
- make -C src/cpp library_check | ||
|
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 |
---|---|---|
|
@@ -81,6 +81,7 @@ set_target_properties( | |
xml | ||
|
||
java_bytecode | ||
java-models-library | ||
jbmc | ||
jbmc-lib | ||
janalyzer | ||
|
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
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
add_subdirectory(regression) | ||
add_subdirectory(src) | ||
add_subdirectory(unit) | ||
|
||
add_custom_target(java-models-library ALL | ||
COMMAND mvn package | ||
COMMAND cp target/core-models.jar ${CMAKE_CURRENT_SOURCE_DIR}/src/java_bytecode/library/ | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/java-models-library | ||
) |
Submodule java-models-library
added at
6b422b
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CORE | ||
TestClass.class | ||
--function TestClass.testFunction --classpath ../../../src/java_bytecode/library/core-models.jar:. | ||
--function TestClass.testFunction --classpath `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` | ||
EXIT=0 | ||
SIGNAL=0 | ||
VERIFICATION SUCCESSFUL |
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 |
---|---|---|
@@ -1,32 +1,2 @@ | ||
message(STATUS "Downloading java-models-library...") | ||
include("${CBMC_SOURCE_DIR}/../cmake/DownloadProject.cmake") | ||
|
||
# Note: 'PATCH_COMMAND' is being used instead of 'COMMAND' as | ||
# 'download_project' does not work as expected if called without | ||
# 'PATCH_COMMAND'. | ||
download_project(PROJ java_models_library | ||
URL https://github.com/diffblue/java-models-library/archive/master.zip | ||
PATCH_COMMAND cmake -E copy_directory "${CMAKE_BINARY_DIR}/java_models_library-src/src" | ||
"${JBMC_SOURCE_DIR}/java_bytecode/library/src" | ||
) | ||
|
||
find_package(Java REQUIRED) | ||
include(UseJava) | ||
|
||
set(CMAKE_JAVA_COMPILE_FLAGS -sourcepath "src" -d "classes" -XDignore.symbol.file) | ||
|
||
# create a target for the executable performing the .jar -> .inc conversion | ||
add_executable(java-converter converter.cpp) | ||
|
||
# create a target 'core-models.jar' that depends on all .java files in src/ | ||
file(GLOB_RECURSE java_sources "src/*.java") | ||
add_jar("core-models" ${java_sources}) | ||
|
||
# copy 'core-models.jar' to '<PROJECT_ROOT>/jbmc/src/java_bytecode/library'. | ||
# This is needed to deal with unit tests that make use of the core-models | ||
# library. So that they can find the 'core-models.jar' in the same place as | ||
# if the project had been compiled with 'make'. | ||
add_custom_command(TARGET core-models | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy "core-models.jar" ${PROJECT_SOURCE_DIR}/java_bytecode/library | ||
) |
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 |
---|---|---|
@@ -1,43 +1,34 @@ | ||
.NOTPARALLEL: | ||
#javac compiles multiple classes for each source as it will compile dependent sources. | ||
#Thus we do not allow the make to run concurrently. | ||
SRC = converter.cpp \ | ||
# Empty last line | ||
|
||
include ../../config.inc | ||
include ../../$(CPROVER_DIR)/src/config.inc | ||
include ../../$(CPROVER_DIR)/src/common | ||
|
||
SOURCE_DIR := src/main/java | ||
BINARY_DIR := classes | ||
|
||
FIND := find | ||
OBJ += | ||
|
||
JAVAC := javac | ||
JFLAGS := -sourcepath $(SOURCE_DIR) -d $(BINARY_DIR) -XDignore.symbol.file | ||
INCLUDES= | ||
|
||
CLASSPATH := SOURCE_DIR | ||
LIBS = | ||
|
||
ALL_JAVAS := $(wildcard $(SOURCE_DIR)/*/*.java $(SOURCE_DIR)/*/*/*.java $(SOURCE_DIR)/*/*/*/*.java) | ||
ALL_CLASSES := $(patsubst $(SOURCE_DIR)/%.java,$(BINARY_DIR)/%.class,$(ALL_JAVAS)) | ||
LIBRARY_DIR = ../../../lib/java-models-library | ||
|
||
$(BINARY_DIR): | ||
mkdir -p $(BINARY_DIR) | ||
|
||
.SUFFIXES: .java .class | ||
include ../../config.inc | ||
include ../../$(CPROVER_DIR)/src/config.inc | ||
include ../../$(CPROVER_DIR)/src/common | ||
|
||
$(BINARY_DIR)/%.class: $(SOURCE_DIR)/%.java $(BINARY_DIR) | ||
$(JAVAC) $(JFLAGS) $(patsubst $(BINARY_DIR)/%.class,$(SOURCE_DIR)/%.java,$@) | ||
CLEANFILES = converter$(EXEEXT) | ||
|
||
JAR := jar | ||
JARFLAGS := -cf | ||
all: library converter$(EXEEXT) | ||
|
||
core-models.jar: $(BINARY_DIR) $(ALL_CLASSES) | ||
$(JAR) $(JARFLAGS) $@ -C $(BINARY_DIR) . | ||
clean: clean_library | ||
|
||
CLEANFILES = core-models.jar | ||
.PHONY: clean_library | ||
clean_library: | ||
rm -rf core-models.jar | ||
if [ -d $(LIBRARY_DIR) ]; then cd $(LIBRARY_DIR); mvn clean; fi | ||
|
||
all: core-models.jar | ||
.PHONY: library | ||
library: | ||
if [ -d $(LIBRARY_DIR) ]; then (cd $(LIBRARY_DIR); mvn package); cp $(LIBRARY_DIR)/target/core-models.jar .; fi | ||
|
||
clean: clean_ | ||
############################################################################### | ||
|
||
clean_: | ||
$(RM) -Rf $(BINARY_DIR) | ||
converter$(EXEEXT): $(OBJ) | ||
$(LINKBIN) |