Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cknieling/msi installer #197

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build
/install
/.idea
/src/.idea
/src/Pipfile.lock
Expand Down
76 changes: 73 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.esri.zrh.jenkins.ce.CityEnginePipelineLibrary
import com.esri.zrh.jenkins.ce.PrtAppPipelineLibrary
import com.esri.zrh.jenkins.PslFactory
import com.esri.zrh.jenkins.psl.UploadTrackingPsl
import com.esri.zrh.jenkins.ToolInfo

@Field def psl = PslFactory.create(this, UploadTrackingPsl.ID)
@Field def cepl = new CityEnginePipelineLibrary(this, psl)
Expand Down Expand Up @@ -46,6 +47,8 @@ import com.esri.zrh.jenkins.psl.UploadTrackingPsl
[ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, houdini: '19.5' ],
]

@Field final List INSTALLER_CONFIG = [ [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64 ] ]
@Field final List INSTALLER_HOUDINI_VERS = [ '18.5', '19.0', '19.5' ]

// -- SETUP

Expand All @@ -68,6 +71,10 @@ stage('build') {
cepl.runParallel(taskGenBuild())
}

stage('installer') {
cepl.runParallel(taskGenInstaller())
}

papl.finalizeRun('palladio', env.BRANCH_NAME)


Expand All @@ -93,6 +100,12 @@ Map taskGenBuild() {
return tasks;
}

Map taskGenInstaller() {
Map tasks = [:]
tasks << cepl.generateTasks('pld-msi', this.&taskCreateInstaller, INSTALLER_CONFIG)
return tasks;
}


// -- TASK BUILDERS

Expand All @@ -106,7 +119,7 @@ def taskRunTest(cfg) {
cepl.cleanCurrentDir()
unstash(name: SOURCE_STASH)
dir(path: 'build') {
papl.runCMakeBuild(SOURCE, 'build_and_run_tests', cfg, [])
papl.runCMakeBuild(SOURCE, 'build_and_run_tests', cfg, [], JenkinsTools.CMAKE319)
}
junit('build/test/palladio_test_report.xml')
}
Expand All @@ -121,7 +134,18 @@ def taskBuildPalladio(cfg) {
cepl.cleanCurrentDir()
unstash(name: SOURCE_STASH)
dir(path: 'build') {
papl.runCMakeBuild(SOURCE, BUILD_TARGET, cfg, defs)
papl.runCMakeBuild(SOURCE, BUILD_TARGET, cfg, defs, JenkinsTools.CMAKE319)
}
final String artifactPattern = "palladio-*"

if(cfg.os == cepl.CFG_OS_WIN10){
dir(path: 'build'){
stashFile = cepl.findOneFile(artifactPattern)
echo("stashFile: '${stashFile}'")
stash(includes: artifactPattern, name: "houdini${cfg.houdini.replace('.', '_')}")
stashPath = "${stashFile.path}"
echo("file path to stash: '${stashPath}'")
}
}

def versionExtractor = { p ->
Expand All @@ -132,5 +156,51 @@ def taskBuildPalladio(cfg) {
def cls = (p =~ /.*palladio-.*\.(hdn.*)-(windows|linux)\..*/)
return cls[0][1] + '.' + cepl.getArchiveClassifier(cfg)
}
papl.publish('palladio', env.BRANCH_NAME, "palladio-*", versionExtractor, cfg, classifierExtractor)
papl.publish('palladio', env.BRANCH_NAME, artifactPattern, versionExtractor, cfg, classifierExtractor)
}

def taskCreateInstaller(cfg) {
final String appName = 'palladio-installer'
cepl.cleanCurrentDir()
unstash(name: SOURCE_STASH)

String pyArgs = ""

// fetch outputs from builds
dir(path: 'build'){
dir(path: 'tmp'){
INSTALLER_HOUDINI_VERS.each { mv ->
unstash(name: "houdini${mv.replace('.', '_')}")
def zipFile = cepl.findOneFile("*hdn${mv.replace('.', '-')}*.zip")
final String zipFileName = zipFile.name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check if the zipFile has been found or explict error with a message otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to findOneFile already throws an error if the file isn't found

unzip(zipFile:zipFileName)
pyArgs += "-h${mv.replace('.', '')} \"build\\tmp\\${zipFileName.take(zipFileName.lastIndexOf('.'))}\" "
}
}
}
pyArgs += "-bv ${env.BUILD_NUMBER} "
pyArgs += "-bd \"build\\build_msi\" "

// Toolchain definition for building MSI installers.
final JenkinsTools compiler = cepl.getToolchainTool(cfg)
final def toolchain = [
new ToolInfo(JenkinsTools.WIX, cfg),
new ToolInfo(compiler, cfg)
]

// Setup environment according to above toolchain definition.
withTool(toolchain) {
psl.runCmd('python "palladio.git\\deploy\\build.py" ' + pyArgs)
chr11115 marked this conversation as resolved.
Show resolved Hide resolved

def buildProps = papl.jpe.readProperties(file: 'build/build_msi/deployment.properties')

final String artifactPattern = "build_msi/${buildProps.package_file}"
final def artifactVersion = { p -> buildProps.package_version }

def classifierExtractor = { p ->
return cepl.getArchiveClassifier(cfg)
}

papl.publish(appName, env.BRANCH_NAME, artifactPattern, artifactVersion, cfg, classifierExtractor)
}
}
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,12 @@ It can be useful to put RPKs into an `rpk` sub-directory of your current Houdini
* RedHat Enterprise Linux 7 or 8 and compatible (CentOS, Alma Linux, Rocky Linux, ...)

### Required Toolchain & Compiler
* [cmake 3.13 or later](https://cmake.org/download)
* [cmake 3.19 or later](https://cmake.org/download)
* [conan 1.20 or later](https://www.conan.io/downloads)
* Linux: GCC 9.3
* Windows: Visual Studio 2019 (MSVC 14.27)
* [WiX Toolset 3.11.1 or later](https://wixtoolset.org/docs/wix3/): Optional, required for building .msi installers
* Python 3.6 or later: Optional, required for building .msi installers

### Required Build Dependencies (Latest Release)
* Installation of Houdini 18.5, 19.0 or 19.5 (see https://sidefx.com/download)
Expand Down Expand Up @@ -314,6 +316,16 @@ See [Quick Start](#quick-start) how to launch Houdini with Palladio.
1. `nmake palladio_test`
1. Run `bin\palladio_test`

### Building Windows MSI installer
chr11115 marked this conversation as resolved.
Show resolved Hide resolved
1. Open a MSVC 14.27 x64 shell (Visual Studio 2019) and `cd` to the Palladio git repository
1. for each houdini version build the binary files to a local install folder:
1. `mkdir build/installer_XXY` (i.e. `installer_195`)
1. `cd build/installer_XXY`
1. `cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="../../install/houdiniXX.Y" ../../src`
1. `nmake install` (the plugin will be installed to `install/houdiniXX.Y`)
1. From a terminal run `deploy\build.py` and provide the binary folders via `-hXXY "install/houdiniXX.Y"`
1. The MSI installer should now be located in `build/build_msi/`

## Release Notes

### v2.0.0 Beta 1 (Okt 13, 2022)
Expand All @@ -328,6 +340,7 @@ Required CityEngine version: 2022.0 or older.
- CGA annotations will create different UI widgets, for example a color picker or file browser
- Seed parameter to change the seed value in the `pldAssign` node
- Icon to Palladio nodes
- MSI windows installer

#### Changed:
- Updated Procedural Runtime (PRT) to 2.6.8300 (corresponds to CityEngine 2022.0)
Expand All @@ -337,6 +350,7 @@ Required CityEngine version: 2022.0 or older.

#### Development:
- Updated compilers (now using C++ 17)
- Updated required cmake version to 3.19
- Linux version is now compiled with GCC 9.3 by default
- Updated test framework and build system
- Cleaned up CMake files
Expand Down
Loading