Skip to content

Commit 6dc1ee2

Browse files
committed
Cake build
1 parent 87f23d9 commit 6dc1ee2

File tree

6 files changed

+229
-148
lines changed

6 files changed

+229
-148
lines changed

.build/Plugin.Badge.nuspec

Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
22
<metadata>
33
<id>Plugin.Badge</id>
4-
<version>1.3.0</version>
4+
<version>2.0.0</version>
55
<title>Tab Badge for Xamarin.Forms</title>
66
<authors>Adrian Seceleanu</authors>
77
<owners>Adrian Seceleanu</owners>
@@ -14,66 +14,43 @@
1414
<tags>xamarin xamarin.forms badge tab tabbar monodroid Xamarin.iOS uwp uap android ios windows universal mac macos osx</tags>
1515
<iconUrl>https://raw.githubusercontent.com/xabre/xamarin-forms-tab-badge/master/icon_small.png</iconUrl>
1616
<releaseNotes>
17-
[1.3.0]
18-
- #33 Updated dependencies to Xamarin Forms 2.4.0.280 (first stable 2.4.x)
19-
- #37 #20 [Android][MacOS][UWP] Bindable badge postion and margin
20-
[1.3.0-beta]
21-
- #31 MacOS support
22-
[1.2.1]
23-
- #20 Support for more badge postions: TopCenter, BottomCenter, LeftCenter, RightCenter
24-
[1.2.0]
25-
- #8 #20 #36 Bindable badge position for Android and UWP
26-
[1.2.0-beta3]
27-
- UAP ensure missing *.xr.xml is also copied.
28-
- UAP XF dependency updated
29-
- #26 UWP support
30-
[1.1.3]
31-
- #25 enusure registered event handlers are cleaned up before new ones are registered
32-
[1.1.2]
33-
- #23 Use ViewCompat.SetBackground to prevent missing method crash on Android API 15
34-
[1.1.1]
35-
- #22 #24 Responds to selector check for iOS text attributes. Prevents crash for versions earlier than iOS 10.
36-
[1.1.0]
37-
- #19 Badge Text Color
38-
- #20 Badge font and font attributes
39-
- #15 final fix for missing method in android
40-
[1.0.2]
41-
- #15 fixed support for android support libs 25.3.1
42-
- tested sample app with latest XF and android support version
43-
[1.0.1]
44-
- #7 Responds to selector check for iOS badge color. Prevents crash for versions earlier than iOS 10.
45-
[1.0.0]
46-
- stable release
17+
[2.0.0]
18+
- NET Standard support
19+
- Changelog: https://raw.githubusercontent.com/xabre/xamarin-forms-tab-badge/master/changelog.md
4720
</releaseNotes>
4821
<dependencies>
22+
<group targetFramework="netstandard1.4">
23+
<dependency id="Xamarin.Forms" version="2.5.0.280555" />
24+
</group>
4925
<group targetFramework="MonoAndroid10">
50-
<dependency id="Xamarin.Forms" version="2.4.0.280" />
26+
<dependency id="Xamarin.Forms" version="2.5.0.280555" />
5127
</group>
5228
<group targetFramework="Xamarin.iOS10">
53-
<dependency id="Xamarin.Forms" version="2.4.0.280" />
54-
</group>
55-
<group targetFramework="portable-net45+win+wpa81+wp80">
56-
<dependency id="Xamarin.Forms" version="2.4.0.280" />
57-
</group>
29+
<dependency id="Xamarin.Forms" version="2.5.0.280555" />
30+
</group>
5831
<group targetFramework="uap10.0">
59-
<dependency id="Xamarin.Forms" version="2.4.0.280" />
32+
<dependency id="Xamarin.Forms" version="2.5.0.280555" />
6033
</group>
6134
<group targetFramework="xamarinmac20">
62-
<dependency id="Xamarin.Forms" version="2.4.0.280" />
35+
<dependency id="Xamarin.Forms" version="2.5.0.280555" />
6336
</group>
6437
</dependencies>
6538
</metadata>
6639
<files>
67-
<!-- PCL -->
68-
<file src="pcl\Plugin.Badge.*" target="lib\portable-net45+win8+wpa81+wp8" />
40+
<!-- .net standard -->
41+
<file src="out\lib\netstandard1.4\Plugin.Badge.*" target="lib\netstandard1.4" />
42+
6943
<!-- droid -->
70-
<file src="android\Plugin.Badge.*" target="lib\MonoAndroid10" />
44+
<file src="out\lib\android\Plugin.Badge.*" target="lib\MonoAndroid10" />
45+
7146
<!-- iOS -->
72-
<file src="ios\Plugin.Badge.*" target="lib\Xamarin.iOS10" />
73-
<!-- uap -->
74-
<file src="uwp\Plugin.Badge.*" target="lib\uap10.0" />
75-
<file src="uwp\Plugin.Badge.*.xml" target="lib\uap10.0\Plugin.Badge.UWP" />
47+
<file src="out\lib\ios\Plugin.Badge.*" target="lib\Xamarin.iOS10" />
48+
7649
<!-- uap -->
77-
<file src="macos\Plugin.Badge.*" target="lib\xamarinmac20" />
50+
<file src="out\lib\uwp\Plugin.Badge.*" target="lib\uap10.0" />
51+
<file src="out\lib\uwp\Plugin.Badge.*.xml" target="lib\uap10.0\Plugin.Badge.UWP" />
52+
53+
<!-- mac -->
54+
<file src="out\lib\mac\Plugin.Badge.*" target="lib\xamarinmac20" />
7855
</files>
7956
</package>

.build/build.cake

Lines changed: 0 additions & 60 deletions
This file was deleted.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ Thumbs.db
4848
/.build/FAKE.4.61.3
4949
/Source/.vs/Plugin.Badge/v15/sqlite3/storage.ide
5050
/Source/.vs/Plugin.Badge/v15
51+
/nuget
52+
/Source/Plugin.Badge.UWP/.build/out/lib/uwp
53+
/Source/Plugin.Badge.Mac/.build/out/lib/macos
54+
/Source/Plugin.Badge.iOS/.build/out/lib/ios
55+
/Source/Plugin.Badge.Droid/.build/out/lib/android
56+
/Source/Plugin.Badge.Abstractions/.build/out/lib
57+
/tools
58+
/.vscode

build.cake

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#addin "Cake.Xamarin"
2+
#addin nuget:?package=Cake.Git
3+
4+
using Path = System.IO.Path;
5+
using System.Xml.Linq;
6+
using System.Xml;
7+
8+
var target = Argument("target", "Build");
9+
10+
var NuGetTargetDir = MakeAbsolute(Directory(".build/out/nuget"));
11+
var BuildTargetDir = MakeAbsolute(Directory(".build/out/lib"));
12+
var ProjectSources = MakeAbsolute(Directory("./Source"));
13+
var NuspecFiles = new []{".build/Plugin.Badge.nuspec"};
14+
15+
string GetProjectDir(string projectName)
16+
{
17+
return ProjectSources.Combine(projectName).CombineWithFilePath(projectName + ".csproj").FullPath;
18+
}
19+
20+
void BuildProject(string projectName, string targetSubDir)
21+
{
22+
Information("Building {0} ...", projectName);
23+
var project = GetProjectDir(projectName);
24+
var outputDir = BuildTargetDir.Combine(targetSubDir);
25+
MSBuild(project, settings => settings
26+
.SetConfiguration("Release")
27+
.WithTarget("Build")
28+
.SetMSBuildPlatform(MSBuildPlatform.x86)
29+
.WithProperty("OutDir", outputDir.FullPath));
30+
}
31+
32+
// string NuVersionGet (string specFile)
33+
// {
34+
// var doc = System.Xml.Linq.XDocument.Load(specFile);
35+
// var versionElements = doc.Descendants(XName.Get("version", doc.Root.Name.NamespaceName));
36+
// return versionElements.First().Value;
37+
// }
38+
39+
// void NuVersionSet (string specFile, string version)
40+
// {
41+
// var xmlDocument = System.Xml.Linq.XDocument.Load(specFile);
42+
// var nsmgr = new XmlNamespaceManager(new XmlNameTable());
43+
// nsmgr.AddNamespace("ns", "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd");
44+
// var node = xmlDocument.Document.SelectSingleNode("//ns:version", nsmgr);
45+
// node.InnerText = version;
46+
// xmlDocument.Save(specFile);
47+
// }
48+
49+
Task("Restore")
50+
.Does(() =>
51+
{
52+
var solutions = GetFiles("./Source/*.sln");
53+
// Restore all NuGet packages.
54+
foreach(var solution in solutions)
55+
{
56+
Information("Restoring {0}", solution);
57+
NuGetRestore(solution);
58+
}
59+
});
60+
61+
Task("Build")
62+
.IsDependentOn("Clean")
63+
.IsDependentOn("Restore")
64+
.Does(() =>
65+
{
66+
BuildProject("Plugin.Badge.Abstractions", "netstandard1.4");
67+
BuildProject("Plugin.Badge.Droid", "android");
68+
BuildProject("Plugin.Badge.iOS", "ios");
69+
BuildProject("Plugin.Badge.Mac", "mac");
70+
BuildProject("Plugin.Badge.UWP", "uwp");
71+
});
72+
73+
Task("Clean").Does (() =>
74+
{
75+
if (DirectoryExists (BuildTargetDir))
76+
DeleteDirectory (BuildTargetDir, true);
77+
78+
CleanDirectories ("./**/bin");
79+
CleanDirectories ("./**/obj");
80+
});
81+
82+
Task("Version")
83+
.Does(() => {
84+
var version = Argument<string>("ver", "");
85+
var cleanVersion = System.Text.RegularExpressions.Regex.Replace(version, @"[^\d\.].*$", "");
86+
87+
if(string.IsNullOrEmpty(cleanVersion))
88+
{
89+
throw new ArgumentNullException(nameof(version));
90+
}
91+
92+
// ReplaceRegexInFiles("./your/AssemblyInfo.cs", "(?<=AssemblyVersion\\(\")(.+?)(?=\"\\))", cleanVersion);
93+
});
94+
95+
Task("Pack")
96+
.IsDependentOn("Build")
97+
.Does(() =>
98+
{
99+
foreach(var nuspec in NuspecFiles)
100+
{
101+
NuGetPack(nuspec, new NuGetPackSettings()
102+
{
103+
OutputDirectory = "./.build/nuget"
104+
});
105+
}
106+
});
107+
108+
Task("Publish")
109+
.IsDependentOn("Build")
110+
.Does(() =>
111+
{
112+
var nupack = GetFiles("./.build/nuget/*.nuspec").FirstOrDefault();
113+
NuGetPush(nupack.FullPath);
114+
});
115+
116+
RunTarget(target);

0 commit comments

Comments
 (0)