forked from roubachof/Sharpnado.CollectionView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-package.ps1
64 lines (46 loc) · 2.05 KB
/
make-package.ps1
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
$formsVersion = "4.5.0.356"
$hlvProject = ".\Sharpnado.CollectionView\Sharpnado.CollectionView.csproj"
$droidHLVProject = ".\Sharpnado.CollectionView.Droid\Sharpnado.CollectionView.Droid.csproj"
$iosHLVProject = ".\Sharpnado.CollectionView.iOS\Sharpnado.CollectionView.iOS.csproj"
$droidBin = ".\Sharpnado.CollectionView.Droid\bin\Release"
$droidObj = ".\Sharpnado.CollectionView.Droid\obj\Release"
rm *.txt
echo " Setting Xamarin.Forms version to $formsVersion"
$findXFVersion = '(Xamarin.Forms">\s+<Version>)(.+)(<\/Version>)'
$replaceString = "`$1 $formsVersion `$3"
(Get-Content $hlvProject -Raw) -replace $findXFVersion, "$replaceString" | Out-File $hlvProject
(Get-Content $droidHLVProject -Raw) -replace $findXFVersion, "$replaceString" | Out-File $droidHLVProject
(Get-Content $iosHLVProject -Raw) -replace $findXFVersion, "$replaceString" | Out-File $iosHLVProject
echo "########################################"
echo "# Sharpnado.CollectionView"
echo "########################################"
echo " deleting android bin-obj folders"
rm -Force -Recurse $droidBin
rm -Force -Recurse $droidObj
echo " cleaning Sharpnado.CollectionView solution"
msbuild .\Sharpnado.CollectionView.sln /t:Clean
if ($LastExitCode -gt 0)
{
echo " Error while cleaning solution"
return
}
echo " restoring Sharpnado.CollectionView solution packages"
msbuild .\Sharpnado.CollectionView.sln /t:Restore
if ($LastExitCode -gt 0)
{
echo " Error while restoring packages"
return
}
echo " building Sharpnado.CollectionView solution"
msbuild .\Sharpnado.CollectionView.sln /t:Build /p:Configuration=Release
if ($LastExitCode -gt 0)
{
echo " Error while building solution"
return
}
echo "###############################################"
echo "# Packaging"
echo "###############################################"
$version = (Get-Item Sharpnado.CollectionView\bin\Release\netstandard2.0\Sharpnado.CollectionView.dll).VersionInfo.FileVersion
echo " packaging Sharpnado.CollectionView.nuspec (v$version)"
nuget pack .\Sharpnado.CollectionView.nuspec -Version $version