Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 02b64d3

Browse files
authored
Merge pull request #159 from xamarin/mattleibow/mapper
Added the AndroidX mapper/merger to Support branch
2 parents df95df2 + 1703108 commit 02b64d3

16 files changed

+3266
-20
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ Details.md
3333
cake.sh
3434
**/.mfractor/**
3535

36-
util/
36+
util/binderator/
3737
*.binlog

build.cake

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
var TARGET = Argument ("t", Argument ("target", "Default"));
1717
var BUILD_CONFIG = Argument ("config", "Release");
18+
var VERBOSITY = (Verbosity) Enum.Parse (typeof(Verbosity), Argument ("v", Argument ("verbosity", "Normal")), true);
1819

1920
// Lists all the artifacts and their versions for com.android.support.*
2021
// https://dl.google.com/dl/android/maven2/com/android/support/group-index.xml
@@ -52,6 +53,8 @@ if (IsRunningOnWindows ()) {
5253
MSCORLIB_PATH = MakeAbsolute (DOTNETDIR.Combine("Framework/v4.0.30319/")).FullPath;
5354
}
5455

56+
var ANDROIDX_MAPPER_EXE = MakeAbsolute ((FilePath)$"util/AndroidXMapper/AndroidXMapper/bin/{BUILD_CONFIG}/net47/AndroidXMapper.exe");
57+
5558
Information ("MONODROID_PATH: {0}", MONODROID_PATH);
5659
Information ("MSCORLIB_PATH: {0}", MSCORLIB_PATH);
5760

@@ -169,6 +172,18 @@ Task("nuget-validation")
169172

170173
});
171174

175+
Task ("androidxmapper")
176+
.Does (() =>
177+
{
178+
MSBuild (
179+
"./util/AndroidXMapper/AndroidXMapper.sln", c => {
180+
c.Configuration = BUILD_CONFIG;
181+
c.MaxCpuCount = 0;
182+
c.Verbosity = VERBOSITY;
183+
c.Restore = true;
184+
});
185+
});
186+
172187
Task ("diff")
173188
.WithCriteria (!IsRunningOnWindows ())
174189
.IsDependentOn ("merge")
@@ -201,33 +216,25 @@ Task ("diff")
201216
});
202217

203218
Task ("merge")
219+
.IsDependentOn ("androidxmapper")
204220
.IsDependentOn ("libs")
205221
.Does (() =>
206222
{
207-
EnsureDirectoryExists("./output/");
208-
209-
if (FileExists ("./output/AndroidSupport.Merged.dll"))
210-
DeleteFile ("./output/AndroidSupport.Merged.dll");
211-
212-
var allDlls = GetFiles ("./generated/**/bin/Release/" + TF_MONIKER + "/*.dll");
213-
223+
var allDlls = GetFiles ($"./generated/*/bin/{BUILD_CONFIG}/{TF_MONIKER}/Xamarin.*.dll");
214224
var mergeDlls = allDlls
215225
.GroupBy(d => new FileInfo(d.FullPath).Name)
216226
.Select(g => g.FirstOrDefault())
217-
.Where (g => !g.FullPath.Contains("v4") && !g.FullPath.Contains(".Android.Support.Constraint.Layout."))
218227
.ToList();
219228

220-
Information("Merging: \n {0}", string.Join("\n", mergeDlls));
221-
222-
// Wait for ILRepack support in cake-0.5.2
223-
ILRepack ("./output/AndroidSupport.Merged.dll", mergeDlls.First(), mergeDlls.Skip(1), new ILRepackSettings {
224-
CopyAttrs = true,
225-
AllowMultiple = true,
226-
//TargetKind = ILRepack.TargetKind.Dll,
227-
Libs = new List<DirectoryPath> {
228-
MONODROID_PATH
229-
},
230-
});
229+
EnsureDirectoryExists("./output/");
230+
var result = StartProcess(ANDROIDX_MAPPER_EXE,
231+
$"merge" +
232+
$" -a {string.Join(" -a ", mergeDlls)} " +
233+
$" -o " + MakeAbsolute((FilePath)"./output/AndroidSupport.Merged.dll") +
234+
$" -s \"{MONODROID_PATH}\" " +
235+
$" --inject-assemblyname");
236+
if (result != 0)
237+
throw new Exception($"The androidxmapper failed with error code {result}.");
231238
});
232239

233240
Task ("ci-setup")

util/AndroidXMapper/.gitignore

Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
bld/
21+
[Bb]in/
22+
[Oo]bj/
23+
24+
# Visual Studio 2015 cache/options directory
25+
.vs/
26+
# Uncomment if you have tasks that create the project's static files in wwwroot
27+
#wwwroot/
28+
29+
# MSTest test Results
30+
[Tt]est[Rr]esult*/
31+
[Bb]uild[Ll]og.*
32+
33+
# NUNIT
34+
*.VisualState.xml
35+
TestResult.xml
36+
37+
# Build Results of an ATL Project
38+
[Dd]ebugPS/
39+
[Rr]eleasePS/
40+
dlldata.c
41+
42+
# DNX
43+
project.lock.json
44+
artifacts/
45+
46+
*_i.c
47+
*_p.c
48+
*_i.h
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.tmp_proj
63+
*.log
64+
*.vspscc
65+
*.vssscc
66+
.builds
67+
*.pidb
68+
*.svclog
69+
*.scc
70+
71+
# Chutzpah Test files
72+
_Chutzpah*
73+
74+
# Visual C++ cache files
75+
ipch/
76+
*.aps
77+
*.ncb
78+
*.opendb
79+
*.opensdf
80+
*.sdf
81+
*.cachefile
82+
83+
# Visual Studio profiler
84+
*.psess
85+
*.vsp
86+
*.vspx
87+
*.sap
88+
89+
# TFS 2012 Local Workspace
90+
$tf/
91+
92+
# Guidance Automation Toolkit
93+
*.gpState
94+
95+
# ReSharper is a .NET coding add-in
96+
_ReSharper*/
97+
*.[Rr]e[Ss]harper
98+
*.DotSettings.user
99+
100+
# JustCode is a .NET coding add-in
101+
.JustCode
102+
103+
# TeamCity is a build add-in
104+
_TeamCity*
105+
106+
# DotCover is a Code Coverage Tool
107+
*.dotCover
108+
109+
# NCrunch
110+
_NCrunch_*
111+
.*crunch*.local.xml
112+
nCrunchTemp_*
113+
114+
# MightyMoose
115+
*.mm.*
116+
AutoTest.Net/
117+
118+
# Web workbench (sass)
119+
.sass-cache/
120+
121+
# Installshield output folder
122+
[Ee]xpress/
123+
124+
# DocProject is a documentation generator add-in
125+
DocProject/buildhelp/
126+
DocProject/Help/*.HxT
127+
DocProject/Help/*.HxC
128+
DocProject/Help/*.hhc
129+
DocProject/Help/*.hhk
130+
DocProject/Help/*.hhp
131+
DocProject/Help/Html2
132+
DocProject/Help/html
133+
134+
# Click-Once directory
135+
publish/
136+
137+
# Publish Web Output
138+
*.[Pp]ublish.xml
139+
*.azurePubxml
140+
# TODO: Comment the next line if you want to checkin your web deploy settings
141+
# but database connection strings (with potential passwords) will be unencrypted
142+
*.pubxml
143+
*.publishproj
144+
145+
# NuGet Packages
146+
*.nupkg
147+
# The packages folder can be ignored because of Package Restore
148+
**/packages/*
149+
# except build/, which is used as an MSBuild target.
150+
!**/packages/build/
151+
# Uncomment if necessary however generally it will be regenerated when needed
152+
#!**/packages/repositories.config
153+
154+
# Microsoft Azure Build Output
155+
csx/
156+
*.build.csdef
157+
158+
# Microsoft Azure Emulator
159+
ecf/
160+
rcf/
161+
162+
# Microsoft Azure ApplicationInsights config file
163+
ApplicationInsights.config
164+
165+
# Windows Store app package directory
166+
AppPackages/
167+
BundleArtifacts/
168+
169+
# Visual Studio cache files
170+
# files ending in .cache can be ignored
171+
*.[Cc]ache
172+
# but keep track of directories ending in .cache
173+
!*.[Cc]ache/
174+
175+
# Others
176+
ClientBin/
177+
~$*
178+
*~
179+
*.dbmdl
180+
*.dbproj.schemaview
181+
*.pfx
182+
*.publishsettings
183+
node_modules/
184+
orleans.codegen.cs
185+
186+
# RIA/Silverlight projects
187+
Generated_Code/
188+
189+
# Backup & report files from converting an old project file
190+
# to a newer Visual Studio version. Backup files are not needed,
191+
# because we have git ;-)
192+
_UpgradeReport_Files/
193+
Backup*/
194+
UpgradeLog*.XML
195+
UpgradeLog*.htm
196+
197+
# SQL Server files
198+
*.mdf
199+
*.ldf
200+
201+
# Business Intelligence projects
202+
*.rdl.data
203+
*.bim.layout
204+
*.bim_*.settings
205+
206+
# Microsoft Fakes
207+
FakesAssemblies/
208+
209+
# GhostDoc plugin setting file
210+
*.GhostDoc.xml
211+
212+
# Node.js Tools for Visual Studio
213+
.ntvs_analysis.dat
214+
215+
# Visual Studio 6 build log
216+
*.plg
217+
218+
# Visual Studio 6 workspace options file
219+
*.opt
220+
221+
# Visual Studio LightSwitch build output
222+
**/*.HTMLClient/GeneratedArtifacts
223+
**/*.DesktopClient/GeneratedArtifacts
224+
**/*.DesktopClient/ModelManifest.xml
225+
**/*.Server/GeneratedArtifacts
226+
**/*.Server/ModelManifest.xml
227+
_Pvt_Extensions
228+
229+
# Paket dependency manager
230+
.paket/paket.exe
231+
232+
# FAKE - F# Make
233+
.fake/
234+
235+
# Xcode
236+
#
237+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
238+
239+
## Build generated
240+
build/
241+
DerivedData
242+
243+
## Various settings
244+
*.pbxuser
245+
!default.pbxuser
246+
*.mode1v3
247+
!default.mode1v3
248+
*.mode2v3
249+
!default.mode2v3
250+
*.perspectivev3
251+
!default.perspectivev3
252+
xcuserdata
253+
254+
## Other
255+
*.xccheckout
256+
*.moved-aside
257+
*.xcuserstate
258+
*.xcscmblueprint
259+
260+
## Obj-C/Swift specific
261+
*.hmap
262+
*.ipa
263+
264+
# CocoaPods
265+
#
266+
# We recommend against adding the Pods directory to your .gitignore. However
267+
# you should judge for yourself, the pros and cons are mentioned at:
268+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
269+
#
270+
# Pods/
271+
272+
# Carthage
273+
#
274+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
275+
# Carthage/Checkouts
276+
277+
Carthage/Build
278+
279+
# fastlane
280+
#
281+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
282+
# screenshots whenever they are needed.
283+
# For more information about the recommended setup visit:
284+
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
285+
286+
fastlane/report.xml
287+
fastlane/screenshots
288+
.vscode/

0 commit comments

Comments
 (0)