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

Fixes #161 PK-Sim portable #235

Merged
merged 11 commits into from Jun 28, 2017
Merged
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -138,6 +138,8 @@ DocProject/Help/html
publish/

setup/deploy/
setup/PK-Sim*
setup/*.zip

# Publish Web Output
*.[Pp]ublish.xml
Expand Down
2 changes: 2 additions & 0 deletions appveyor-nightly.yml
Expand Up @@ -45,6 +45,7 @@ before_build:
after_build:
- rake "create_setup[%APPVEYOR_BUILD_VERSION%, %CONFIGURATION%, C:/smartxls.zip, 2.6.2.9]"
- 7z a setup.zip %APPVEYOR_BUILD_FOLDER%\setup\deploy\*.msi
- rake "create_portable_setup[%APPVEYOR_BUILD_VERSION%, %CONFIGURATION%, pksim-portable-setup.zip]"
Copy link
Member

Choose a reason for hiding this comment

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

there's no actual 'setup' though right?

Copy link
Member Author

Choose a reason for hiding this comment

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

what do you mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

if you mean artifact, then yes it is pushed on appveyor
https://ci.appveyor.com/project/open-systems-pharmacology-ci/pk-sim/build/artifacts

Copy link
Member Author

@msevestre msevestre Jun 28, 2017

Choose a reason for hiding this comment

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

create_setup creates a msi.
create_portable creates a zip
It's symmetrical in that case

Copy link
Member

Choose a reason for hiding this comment

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

you could call the rake task create_portable instead of create_portable_setup that's all. No setup is really created right?


build:
verbosity: minimal
Expand All @@ -57,6 +58,7 @@ notifications:

on_finish:
- ps: Get-ChildItem setup.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem .\setup\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

test:
assemblies:
Expand Down
66 changes: 54 additions & 12 deletions rakefile.rb
Expand Up @@ -14,19 +14,12 @@
end

task :create_setup, [:product_version, :configuration, :smart_xls_package, :smart_xls_version] do |t, args|

require_relative 'scripts/smartxls'

setup_dir = File.join(solution_dir, 'setup')
src_dir = File.join(solution_dir, 'src', 'PKSim', 'bin', args.configuration)
product_version = args.product_version
suite_name = 'Open Systems Pharmacology Suite'

SmartXls.update_smart_xls src_dir, args.smart_xls_package, args.smart_xls_version
update_smart_xls(args)

#Ignore files from automatic harvesting that will be installed specifically
harvest_ignored_files = [
'PKSim.exe'
'PKSim.exe',
'PKSimTemplateDBSystem.mdb'
]

#Files required for setup creation only and that will not be harvested automatically
Expand All @@ -48,17 +41,47 @@

Rake::Task['setup:create'].execute(OpenStruct.new(
solution_dir: solution_dir,
src_dir: src_dir,
src_dir: src_dir_for(args.configuration),
setup_dir: setup_dir,
product_name: product_name,
product_version: product_version,
product_version: args.product_version,
harvest_ignored_files: harvest_ignored_files,
suite_name: suite_name,
setup_files: setup_files,
manufacturer: manufacturer
))
end

task :create_portable_setup, [:product_version, :configuration, :package_name] do |t, args|
#Files required for setup creation only and that will not be harvested automatically
setup_files = [
'Open Systems Pharmacology Suite License.pdf',
'documentation/*.pdf',
'dimensions/*.xml',
'pkparameters/*.xml',
'setup/**/*.{rtf}',
'log4net.config.xml',
]

setup_folders = [
'src/Data/**/*.pksim5',
'packages/**/OSPSuite.Presentation/**/*.{xml}',
'packages/**/OSPSuite.TeXReporting/**/*.{json,sty,tex}',
]

Rake::Task['setup:create_portable'].execute(OpenStruct.new(
solution_dir: solution_dir,
src_dir: src_dir_for(args.configuration),
setup_dir: setup_dir,
product_name: product_name,
product_version: args.product_version,
suite_name: suite_name,
setup_files: setup_files,
setup_folders: setup_folders,
package_name: args.package_name,
))
end

task :update_go_license, [:file_path, :license] do |t, args|
Utils.update_go_diagram_license args.file_path, args.license
end
Expand Down Expand Up @@ -90,6 +113,17 @@

private

def update_smart_xls(args)
require_relative 'scripts/smartxls'

src_dir = src_dir_for(args.configuration)
SmartXls.update_smart_xls src_dir, args.smart_xls_package, args.smart_xls_version
end

def src_dir_for(configuration)
File.join(solution_dir, 'src', 'PKSim', 'bin', configuration)
end

def solution_dir
File.dirname(__FILE__)
end
Expand All @@ -101,3 +135,11 @@ def manufacturer
def product_name
'PK-Sim'
end

def suite_name
'Open Systems Pharmacology Suite'
end

def setup_dir
File.join(solution_dir, 'setup')
end
2 changes: 1 addition & 1 deletion scripts
Submodule scripts updated 1 files
+87 −12 setup.rb
7 changes: 4 additions & 3 deletions setup/setup.wxs
Expand Up @@ -59,9 +59,6 @@
</File>
</Component>

<Component Id='log4net.config.xml' Guid='A6BF052C-E9BA-4959-82B1-5B61011A06AB'>
Copy link
Member Author

Choose a reason for hiding this comment

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

This file should be installed under AppData

<File Name='log4net.config.xml' Id='log4net.config.xml' Source='$(var.DeployDir)/log4net.config.xml' KeyPath='yes' />
</Component>
</Directory>
</Directory>

Expand Down Expand Up @@ -106,6 +103,10 @@
<File Name="PKSimTemplateDBSystem.mdb" Id="PKSimTemplateDBSystem" Source="$(var.DeployDir)/PKSimTemplateDBSystem.mdb" KeyPath="yes" />
</Component>

<Component Id='log4net.config.xml' Guid='A6BF052C-E9BA-4959-82B1-5B61011A06AB'>
<File Name='log4net.config.xml' Id='log4net.config.xml' Source='$(var.DeployDir)/log4net.config.xml' KeyPath='yes' />
</Component>

<Directory Id="ChartLayoutsFolder" Name="ChartLayouts">
<Component Id="ChartLayoutsFolder" Guid="FE800FCC-CF4A-452E-AA9D-E5DF4AF61777">
<CreateFolder Directory="ChartLayoutsFolder">
Expand Down
4 changes: 2 additions & 2 deletions src/PKSim.Assets/PKSim.Assets.csproj
Expand Up @@ -67,8 +67,8 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="OSPSuite.Assets, Version=7.2.0.50, Culture=neutral, processorArchitecture=x86">
<HintPath>..\..\packages\OSPSuite.Assets.7.2.0.50\lib\net452\OSPSuite.Assets.dll</HintPath>
<Reference Include="OSPSuite.Assets, Version=7.2.0.54, Culture=neutral, processorArchitecture=x86">
<HintPath>..\..\packages\OSPSuite.Assets.7.2.0.54\lib\net452\OSPSuite.Assets.dll</HintPath>
</Reference>
<Reference Include="OSPSuite.Utility, Version=2.0.1.2, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\OSPSuite.Utility.2.0.1.2\lib\net45\OSPSuite.Utility.dll</HintPath>
Expand Down