Skip to content

Commit

Permalink
Merge pull request #870 from guillep/versions
Browse files Browse the repository at this point in the history
Enhancement(versionning): Extract full semantic version from git
  • Loading branch information
guillep authored Nov 18, 2024
2 parents 49235a5 + 611d79e commit 96e714d
Show file tree
Hide file tree
Showing 33 changed files with 1,540 additions and 282 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Change log

## What's Changed
* Redo 294 by @guillep in https://github.com/pharo-project/pharo-vm/pull/829
* Making it loadable in P12 by @guillep in https://github.com/pharo-project/pharo-vm/pull/825
* Added test on extended store and pop by @guillep in https://github.com/pharo-project/pharo-vm/pull/520
* Update build version to P12 by @guillep in https://github.com/pharo-project/pharo-vm/pull/826
* Improving log of old space limit error reporting by @tesonep in https://github.com/pharo-project/pharo-vm/pull/833
* a better comment support for Slang by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/838
* a first version of Slang with no type conflict and an exception if one appear by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/819
* remove unused cast and expression by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/837
* fix warnings related to multiple include of the same header file by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/840
* Fix a lot of unused expression by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/832
* add a comment explaining why declareCVarsIn: is empty in some subclasses by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/842
* small change in dead code elimination to considers a method with only comments empty by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/843
* small change in copyWithoutReturn to handle CCoerce by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/836
* Remove hostname lookup on network initialization by @guillep in https://github.com/pharo-project/pharo-vm/pull/845
* Update SDL2 version in OSX (Intel & Apple) by @tesonep in https://github.com/pharo-project/pharo-vm/pull/849
* Adding option for pin behaviour by @tesonep in https://github.com/pharo-project/pharo-vm/pull/844

**Full Changelog**: https://github.com/pharo-project/pharo-vm/compare/v10.3.0...v10.3.1

## v10.3.0

* New harmonize rule by @RenaudFondeur in https://github.com/pharo-project/pharo-vm/pull/817
Expand Down
51 changes: 10 additions & 41 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ option(FEATURE_COMPILE_GNUISATION "Use gcc gnu extensions to compile the VM"
option(PHARO_DEPENDENCIES_PREFER_DOWNLOAD_BINARIES "Prefer downloading dependencies" OFF)
option(FEATURE_COMPILE_INLINE_MEMORY_ACCESSORS "Use inline memory accessors instead of macros" ON)
option(PHARO_VM_IN_WORKER_THREAD "Have support for pharo running in a different thread that the main one" ON)
option(BUILD_IS_RELEASE "Is this a release version?" OFF)
option(DEPENDENCIES_FORCE_BUILD "Force build libraries" OFF)
option(BUILD_WITH_GRAPHVIZ "Generate dependency graphs" ON)
option(VERSION_UPDATE_FROM_GIT "Extract version information from git tags. Default to true. Follow vX.Y.Z-suffix" TRUE)


set(APPNAME "Pharo" CACHE STRING "VM Application name")
set(FLAVOUR "CoInterpreter" CACHE STRING "The kind of VM to generate. Possible values: StackVM, CoInterpreter")
Expand All @@ -47,24 +48,6 @@ if(VERBOSE_BUILD)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
endif(VERBOSE_BUILD)

# Extract VCS information
include(cmake/versionExtraction.cmake)
extractVCSInformation(GIT_COMMIT_HASH GIT_DESCRIBE GIT_COMMIT_DATE)

set(VERSION_MAJOR 10)
set(VERSION_MINOR 3)
set(VERSION_PATCH_NUMBER 0)

if(BUILD_IS_RELEASE)
set(VERSION_PATCH "${VERSION_PATCH_NUMBER}")
else()
set(VERSION_PATCH "${VERSION_PATCH_NUMBER}-${GIT_COMMIT_HASH}")
endif(BUILD_IS_RELEASE)

message(STATUS "Building version ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
message(STATUS "Commit hash ${GIT_COMMIT_HASH} : ${GIT_COMMIT_DATE}")


# Visual Studio stores user build settings in file 'CmakeSettings.json'. We would like to manage that via a project template.
# To push out new template, update 'template_uuid' field in 'template_file' with value from https://www.uuidgenerator.net/
set(user_file "${CMAKE_SOURCE_DIR}/CMakeSettings.json" )
Expand Down Expand Up @@ -99,10 +82,6 @@ endif()
# Configure CMake to load our modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

#Variable used to set the VM date
set(BUILT_FROM "${GIT_DESCRIBE} - Commit: ${GIT_COMMIT_HASH} - Date: ${GIT_COMMIT_DATE}")
message(STATUS ${BUILT_FROM})

# Avoid using the d postfix to debug libraries
# Otherwise, debug libraries change name and breaks FFI bindings
set(CMAKE_DEBUG_POSTFIX "")
Expand All @@ -126,6 +105,12 @@ endif()
#This needs to be at this point, after setting the toolchain configuration
project(PharoVM)

include(cmake/versionExtraction.cmake)

set(BUILT_FROM "${PharoVM_VERSION_STRING_FULL} - Commit: ${PharoVM_VERSION_GIT_SHA} - Date: ${PharoVM_VERSION_GIT_COMMIT_DATE}")
message(STATUS ${BUILT_FROM})


# Correctly set the system processor under MSVC
# This is required because CMake will set the HOST_PROCESSOR in windows
# And not care about our Visual Studio settings
Expand Down Expand Up @@ -198,7 +183,6 @@ if(MSVC)
set(OS_TYPE "Win32")
get_platform_name(VM_TARGET_OS)
message(STATUS "Building for ${VM_TARGET_OS}")
set(CMAKE_CURRENT_SOURCE_DIR_TO_OUT ${CMAKE_CURRENT_SOURCE_DIR})

# Define WIN32_LEAN_AND_MEAN to exclude APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets
# They can be included if needed
Expand All @@ -212,17 +196,6 @@ elseif(WIN)
unset(UNIX)
unset(UNIX CACHE)

# transform the path into a windows path with unix backslashes C:/bla/blu
# this is the path required to send as argument to libraries outside of the control of cygwin (like pharo itself)
execute_process(
COMMAND cygpath ${CMAKE_CURRENT_SOURCE_DIR} --mixed
OUTPUT_VARIABLE CMAKE_CURRENT_SOURCE_DIR_TO_OUT
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND cygpath ${CMAKE_CURRENT_BINARY_DIR} --mixed
OUTPUT_VARIABLE CMAKE_CURRENT_BINARY_DIR_TO_OUT
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
set(CMAKE_SHARED_MODULE_PREFIX "")
Expand All @@ -247,10 +220,6 @@ elseif(WIN)

elseif(UNIX)

# Use the default path to send as argument of extrernal apps (like pharo itself)
set(CMAKE_CURRENT_SOURCE_DIR_TO_OUT ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CURRENT_BINARY_DIR_TO_OUT ${CMAKE_CURRENT_BINARY_DIR})

set(COMMON_FLAGS "-Wall -Werror=implicit-function-declaration")

add_compile_definitions(LSB_FIRST=1)
Expand All @@ -273,9 +242,9 @@ endif()
# If we are generating sources, set the binary dir as the generation source dir, as vmmaker will generate the C files here. (we do not alter the source directory)
# Otherwise set it to by default to the current binary dir, parametrizable
if(${GENERATE_SOURCES})
set(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR_TO_OUT})
set(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR})
else()
set(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR_TO_OUT} CACHE STRING "Source directory where to find the generated source. Default value is CMAKE_CURRENT_BINARY_DIR")
set(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "Source directory where to find the generated source. Default value is CMAKE_CURRENT_BINARY_DIR")
endif()

if (${FEATURE_COMPILE_INLINE_MEMORY_ACCESSORS})
Expand Down
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def runBuild(platformName, configuration, headless = true, someAdditionalParamet
def additionalParameters = someAdditionalParameters

additionalParameters += headless ? "" : " -DALWAYS_INTERACTIVE=1 "
additionalParameters += isRelease() ? " -DBUILD_IS_RELEASE=ON " : " -DBUILD_IS_RELEASE=OFF "

if(configuration == 'StackVM'){
additionalParameters += " -DFEATURE_MESSAGE_COUNT=TRUE "
Expand Down
2 changes: 1 addition & 1 deletion cmake/Windows.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(WIN 1)

set(VM_EXECUTABLE_CONSOLE_NAME "${VM_EXECUTABLE_NAME}Console")
set(VM_VERSION_FILEVERSION "${APPNAME}VM-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${GIT_COMMIT_HASH}")
set(VM_VERSION_FILEVERSION "${APPNAME}VM-${PharoVM_VERSION_STRING_FULL}")

set(Win32ResourcesFolder "${CMAKE_CURRENT_SOURCE_DIR}/resources/windows")

Expand Down
7 changes: 2 additions & 5 deletions cmake/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,13 @@ install(
FILES_MATCHING PATTERN *.h)

set(CPACK_PACKAGE_DESCRIPTION "${APPNAME} Headless VM for ${FULL_PLATFORM_NAME}")
set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
set(CPACK_PACKAGE_VENDOR "${APPNAME}")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://pharo.org")

if(ALWAYS_INTERACTIVE)
set(CPACK_PACKAGE_FILE_NAME "${APPNAME}VM-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH_NUMBER}-${GIT_COMMIT_HASH}-${FULL_PLATFORM_NAME}-stockReplacement")
set(CPACK_PACKAGE_FILE_NAME "${APPNAME}VM-${PharoVM_VERSION_STRING_FULL}-${FULL_PLATFORM_NAME}-stockReplacement")
else()
set(CPACK_PACKAGE_FILE_NAME "${APPNAME}VM-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH_NUMBER}-${GIT_COMMIT_HASH}-${FULL_PLATFORM_NAME}")
set(CPACK_PACKAGE_FILE_NAME "${APPNAME}VM-${PharoVM_VERSION_STRING_FULL}-${FULL_PLATFORM_NAME}")
endif()

set(CPACK_PACKAGE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/packages")
Expand Down
171 changes: 128 additions & 43 deletions cmake/versionExtraction.cmake
Original file line number Diff line number Diff line change
@@ -1,44 +1,129 @@
macro(get_commit_hash VARNAME)
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${VARNAME}
OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro()

macro(get_git_describe VARNAME)
execute_process(
COMMAND git describe --always --tags --first-parent
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${VARNAME}
OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro()

macro(get_git_date VARNAME)
execute_process(
COMMAND git log -1 --format=%ai
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${VARNAME}
OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro()

macro(extractVCSInformation COMMIT_VARNAME DESCRIBE_VARNAME COMMIT_DATE_VARNAME)
get_commit_hash(${COMMIT_VARNAME})
get_git_describe(${DESCRIBE_VARNAME})
get_git_date(${COMMIT_DATE_VARNAME})

if("${${COMMIT_VARNAME}}" STREQUAL "")
#If I don't have information I try to get it from the version.info file next to the sources (if one)
message(STATUS "I couldn't get version information from git, using the version.info next to the sources")
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/version.info FILECONTENT LIMIT_COUNT 3)
list(GET FILECONTENT 0 ${COMMIT_VARNAME})
list(GET FILECONTENT 1 ${DESCRIBE_VARNAME})
list(GET FILECONTENT 2 ${COMMIT_DATE_VARNAME})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/version.info DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
else()
#If I have information for the Commit ID, I store it in the version.info file
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.info ${${COMMIT_VARNAME}}\n)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/version.info ${${DESCRIBE_VARNAME}}\n)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/version.info ${${COMMIT_DATE_VARNAME}})
#
# This cmake module sets the project version and partial version
# variables by analysing the git tag and commit history. It expects git
# tags defined with semantic versioning 2.0.0 (http://semver.org/).
#
# The module expects the PROJECT_NAME variable to be set, and recognizes
# the GIT_FOUND, GIT_EXECUTABLE and VERSION_UPDATE_FROM_GIT variables.
# If Git is found and VERSION_UPDATE_FROM_GIT is set to boolean TRUE,
# the project version will be updated using information fetched from the
# most recent git tag and commit. Otherwise, the module will try to read
# a VERSION file containing the full and partial versions. The module
# will update this file each time the project version is updated.
#
# Once done, this module will define the following variables:
#
# ${PROJECT_NAME}_VERSION_STRING - Version string without metadata
# such as "v2.0.0" or "v1.2.41-beta.1". This should correspond to the
# most recent git tag.
# ${PROJECT_NAME}_VERSION_STRING_FULL - Version string with metadata
# such as "v2.0.0+3.a23fbc" or "v1.3.1-alpha.2+4.9c4fd1"
# ${PROJECT_NAME}_VERSION - Same as ${PROJECT_NAME}_VERSION_STRING,
# without the preceding 'v', e.g. "2.0.0" or "1.2.41-beta.1"
# ${PROJECT_NAME}_VERSION_FULL - Same as ${PROJECT_NAME}_VERSION_STRING_FULL,
# such as "2.0.0+3.a23fbc" or "1.3.1-alpha.2+4.9c4fd1"
# ${PROJECT_NAME}_VERSION_MAJOR - Major version integer (e.g. 2 in v2.3.1-RC.2+21.ef12c8)
# ${PROJECT_NAME}_VERSION_MINOR - Minor version integer (e.g. 3 in v2.3.1-RC.2+21.ef12c8)
# ${PROJECT_NAME}_VERSION_PATCH - Patch version integer (e.g. 1 in v2.3.1-RC.2+21.ef12c8)
# ${PROJECT_NAME}_VERSION_TWEAK - Tweak version string (e.g. "RC.2" in v2.3.1-RC.2+21.ef12c8)
# ${PROJECT_NAME}_VERSION_AHEAD - How many commits ahead of last tag (e.g. 21 in v2.3.1-RC.2+21.ef12c8)
# ${PROJECT_NAME}_VERSION_GIT_SHA - The git sha1 of the most recent commit (e.g. the "ef12c8" in v2.3.1-RC.2+21.ef12c8)
#
# This module is public domain, use it as it fits you best.
#
# Author: Nuno Fachada

# Check if git is found...
if (VERSION_UPDATE_FROM_GIT)
find_package(Git)
endif()

if (GIT_FOUND AND VERSION_UPDATE_FROM_GIT)

# Get last tag from git
execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE)

#How many commits since last tag
execute_process(COMMAND ${GIT_EXECUTABLE} rev-list ${${PROJECT_NAME}_VERSION_STRING}^..HEAD --count
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_VERSION_AHEAD
OUTPUT_STRIP_TRAILING_WHITESPACE)

# Get current commit SHA from git
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_VERSION_GIT_SHA
OUTPUT_STRIP_TRAILING_WHITESPACE)

execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%ai
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_VERSION_GIT_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)

# Get partial versions into a list
string(REGEX MATCHALL "-.*$|[0-9]+" ${PROJECT_NAME}_PARTIAL_VERSION_LIST
${${PROJECT_NAME}_VERSION_STRING})

# Set the version numbers
list(GET ${PROJECT_NAME}_PARTIAL_VERSION_LIST
0 ${PROJECT_NAME}_VERSION_MAJOR)
list(GET ${PROJECT_NAME}_PARTIAL_VERSION_LIST
1 ${PROJECT_NAME}_VERSION_MINOR)
list(GET ${PROJECT_NAME}_PARTIAL_VERSION_LIST
2 ${PROJECT_NAME}_VERSION_PATCH)

# The tweak part is optional, so check if the list contains it
list(LENGTH ${PROJECT_NAME}_PARTIAL_VERSION_LIST
${PROJECT_NAME}_PARTIAL_VERSION_LIST_LEN)
if (${PROJECT_NAME}_PARTIAL_VERSION_LIST_LEN GREATER 3)
list(GET ${PROJECT_NAME}_PARTIAL_VERSION_LIST 3 ${PROJECT_NAME}_VERSION_TWEAK)
string(SUBSTRING ${${PROJECT_NAME}_VERSION_TWEAK} 1 -1 ${PROJECT_NAME}_VERSION_TWEAK)
endif()
endmacro()

# Unset the list
unset(${PROJECT_NAME}_PARTIAL_VERSION_LIST)

# Set full project version string
set(${PROJECT_NAME}_VERSION_STRING_FULL
${${PROJECT_NAME}_VERSION_STRING}+${${PROJECT_NAME}_VERSION_AHEAD}.${${PROJECT_NAME}_VERSION_GIT_SHA})

# Save version to file (which will be used when Git is not available
# or VERSION_UPDATE_FROM_GIT is disabled)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.info ${${PROJECT_NAME}_VERSION_STRING_FULL}
"*" ${${PROJECT_NAME}_VERSION_STRING}
"*" ${${PROJECT_NAME}_VERSION_MAJOR}
"*" ${${PROJECT_NAME}_VERSION_MINOR}
"*" ${${PROJECT_NAME}_VERSION_PATCH}
"*" ${${PROJECT_NAME}_VERSION_TWEAK}
"*" ${${PROJECT_NAME}_VERSION_AHEAD}
"*" ${${PROJECT_NAME}_VERSION_GIT_SHA}
"*" ${${PROJECT_NAME}_VERSION_GIT_COMMIT_DATE})

else()

# Git not available, get version from file
file(STRINGS ${CMAKE_SOURCE_DIR}/version.info ${PROJECT_NAME}_VERSION_LIST)
string(REPLACE "*" ";" ${PROJECT_NAME}_VERSION_LIST ${${PROJECT_NAME}_VERSION_LIST})
# Set partial versions
list(GET ${PROJECT_NAME}_VERSION_LIST 0 ${PROJECT_NAME}_VERSION_STRING_FULL)
list(GET ${PROJECT_NAME}_VERSION_LIST 1 ${PROJECT_NAME}_VERSION_STRING)
list(GET ${PROJECT_NAME}_VERSION_LIST 2 ${PROJECT_NAME}_VERSION_MAJOR)
list(GET ${PROJECT_NAME}_VERSION_LIST 3 ${PROJECT_NAME}_VERSION_MINOR)
list(GET ${PROJECT_NAME}_VERSION_LIST 4 ${PROJECT_NAME}_VERSION_PATCH)
list(GET ${PROJECT_NAME}_VERSION_LIST 5 ${PROJECT_NAME}_VERSION_TWEAK)
list(GET ${PROJECT_NAME}_VERSION_LIST 6 ${PROJECT_NAME}_VERSION_AHEAD)
list(GET ${PROJECT_NAME}_VERSION_LIST 7 ${PROJECT_NAME}_VERSION_GIT_SHA)
list(GET ${PROJECT_NAME}_VERSION_LIST 8 ${PROJECT_NAME}_VERSION_GIT_COMMIT_DATE)

endif()


# Set project version (without the preceding 'v')
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
set(${PROJECT_NAME}_VERSION_FULL ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
if (${PROJECT_NAME}_VERSION_TWEAK)
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION}-${${PROJECT_NAME}_VERSION_TWEAK})
endif()
16 changes: 12 additions & 4 deletions cmake/vmmaker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set(PLUGIN_GENERATED_FILES
if(GENERATE_SOURCES)

#Setting vmmaker directory and image
set( VMMAKER_DIR "${CMAKE_CURRENT_BINARY_DIR_TO_OUT}/build/vmmaker")
set( VMMAKER_DIR "${CMAKE_CURRENT_BINARY_DIR}/build/vmmaker")

# If we are generating the vmmaker image, set a the image path
# Otherwise set it with a default, but parametrizable
Expand Down Expand Up @@ -115,15 +115,23 @@ if(GENERATE_SOURCES)
)
endif()

set(IMAGE_PATH ${VMMAKER_DIR}/image/Pharo12.0-SNAPSHOT-64bit-aa50f9c.image)

convert_cygwin_path_ifNeeded(${IMAGE_PATH} IMAGE_PATH_TO_USE)
convert_cygwin_path_ifNeeded(${VMMAKER_IMAGE} VMMAKER_IMAGE_TO_USE)
convert_cygwin_path_ifNeeded(${CMAKE_CURRENT_SOURCE_DIR} CMAKE_CURRENT_SOURCE_DIR_OUT)
convert_cygwin_path_ifNeeded(${CMAKE_CURRENT_BINARY_DIR} CMAKE_CURRENT_BINARY_DIR_OUT)

if(GENERATE_VMMAKER)
#Bootstrap VMMaker.image from downloaded plain Pharo image

ExternalProject_Add(
vmmaker

URL https://files.pharo.org/image/120/Pharo12.0-SNAPSHOT.build.1519.sha.aa50f9c.arch.64bit.zip
URL_HASH SHA256=b12270631ffc0c6adcb0b6449565b9abfd8e88a863a894a7320f660c05a0af1e
BUILD_COMMAND ${VMMAKER_VM} --headless ${VMMAKER_DIR}/image/Pharo12.0-SNAPSHOT-64bit-aa50f9c.image --no-default-preferences save VMMaker
COMMAND ${VMMAKER_VM} --headless ${VMMAKER_IMAGE} --no-default-preferences --save --quit "${CMAKE_CURRENT_SOURCE_DIR_TO_OUT}/scripts/installVMMaker.st" "${CMAKE_CURRENT_SOURCE_DIR_TO_OUT}" "${ICEBERG_DEFAULT_REMOTE}"
BUILD_COMMAND ${VMMAKER_VM} --headless ${IMAGE_PATH_TO_USE} --no-default-preferences save VMMaker
COMMAND ${VMMAKER_VM} --headless ${VMMAKER_IMAGE_TO_USE} --no-default-preferences --save --quit "${CMAKE_CURRENT_SOURCE_DIR_OUT}/scripts/installVMMaker.st" "${CMAKE_CURRENT_SOURCE_DIR_OUT}" "${ICEBERG_DEFAULT_REMOTE}"
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
Expand All @@ -144,7 +152,7 @@ if(GENERATE_SOURCES)
#Custom command that generates the vm source code from VMMaker into the generated folder
add_custom_command(
OUTPUT ${VMSOURCEFILES} ${PLUGIN_GENERATED_FILES}
COMMAND ${VMMAKER_VM} --headless ${VMMAKER_IMAGE} --no-default-preferences perform PharoVMMaker generate:outputDirectory: ${FLAVOUR} ${CMAKE_CURRENT_BINARY_DIR_TO_OUT}
COMMAND ${VMMAKER_VM} --headless ${VMMAKER_IMAGE_TO_USE} --no-default-preferences perform PharoVMMaker generate:outputDirectory: ${FLAVOUR} ${CMAKE_CURRENT_BINARY_DIR_OUT}
VERBATIM
DEPENDS vmmaker ${VMMAKER_IMAGE} ${VMMAKER_VM}
COMMENT "Generating VM files for flavour: ${FLAVOUR}")
Expand Down
Loading

0 comments on commit 96e714d

Please sign in to comment.