-
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathpackage.ps1
More file actions
73 lines (49 loc) · 2.09 KB
/
package.ps1
File metadata and controls
73 lines (49 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Push-Location
$build_path = "build"
if (Test-Path -Path $build_path) {
Write-Output "Cleaning output dir: $build_path"
Remove-Item "$build_path" -Recurse
}
$package_src_path = "addons/blender-datasmith-export"
$package_dst_path = "$build_path/blender-datasmith-export"
Write-Output "Creating $package_dst_path folder"
New-Item -ItemType directory -Path $package_dst_path
$abs_package_dst_path = Resolve-Path $package_dst_path
Write-Output "Exporting : $package_src_path to $abs_package_dst_path"
Push-Location $package_src_path
git checkout-index --prefix="$abs_package_dst_path/" -a
Remove-Item "$abs_package_dst_path/docs" -Recurse
Pop-Location
$zip_path = "${package_dst_path}.zip"
$compress = @{
Path = $package_dst_path
CompressionLevel = "Fastest"
DestinationPath = $zip_path
}
Write-Output "Creating $zip_path"
Compress-Archive @compress
$template_src = "demos/ue4_template"
$template_path = "$build_path/ue4_template"
Write-Output "Creating $template_path folder"
New-Item -ItemType directory -Path $template_path
Copy-Item -Path "$template_src/Binaries" -Destination "$template_path/" -Recurse
Copy-Item -Path "$template_src/Content" -Destination "$template_path/" -Recurse
Copy-Item -Path "$template_src/Config" -Destination "$template_path/" -Recurse
Copy-Item -Path "$template_src/Plugins" -Destination "$template_path/" -Recurse
Copy-Item -Path "$template_src/Scripts" -Destination "$template_path/" -Recurse
Copy-Item -Path "$template_src/ue4_template.uproject" -Destination "$template_path/"
$plugin_name = "DatasmithBlenderContent"
$plugin_path = "$build_path/$plugin_name"
Write-Output "Creating $plugin_path folder"
Copy-Item -Path "$template_src/Plugins/$plugin_name" -Destination "$plugin_path" -Recurse
Write-Output "Copying README"
Copy-Item -Path "README.txt" -Destination "$build_path/"
$date = Get-Date -Format "yyyy-MM-dd_HHmm"
$build_filename = "${build_path}_${date}.zip"
$final_build_compress = @{
Path = "${build_path}/*"
CompressionLevel = "Fastest"
DestinationPath = $build_filename
}
Write-Output "Creating $build_filename"
Compress-Archive @final_build_compress