Skip to content

Commit 34af711

Browse files
authored
Put a binary copy of mlaunch in macios-binaries instead of in Azure. Fixes #3316. (#3877)
* Put a binary copy of mlaunch in macios-binaries instead of in Azure. Fixes #3316. If the Xamarin build is enabled, then build mlaunch from source, otherwise get it from macios-binaries. Fixes #3316. * Bump macios-binaries. Commit list for xamarin/macios-binaries: * xamarin/macios-binaries@69a9088 Bump mlaunch to xamarin/maccore@4505cd6f02 (#8) Diff: xamarin/macios-binaries@e1e8bdf...69a9088 * make msbuild/ after tools/. Build msbuild/ after tools/, so that mlaunch builds when building from source, since its build needs the MSBuild logic installed by msbuild/. * Bump macios-binaries to get Xcode 9.3-capable mlaunch.
1 parent 256a3f5 commit 34af711

File tree

6 files changed

+49
-40
lines changed

6 files changed

+49
-40
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TOP=.
2-
SUBDIRS=builds runtime fsharp src tools msbuild
2+
SUBDIRS=builds runtime fsharp src msbuild tools
33
include $(TOP)/Make.config
44
include $(TOP)/mk/versions.mk
55

external/macios-binaries

Submodule macios-binaries updated 29 files

tests/xharness/Harness.cs

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -185,45 +185,9 @@ public string MtouchPath {
185185
}
186186
}
187187

188-
string mlaunch;
189188
public string MlaunchPath {
190189
get {
191-
if (mlaunch == null) {
192-
// First check if we've built mlaunch locally.
193-
var filename = Path.GetFullPath (Path.Combine (IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current", "bin", "mlaunch"));
194-
if (File.Exists (filename)) {
195-
Log ("Found mlaunch: {0}", filename);
196-
Environment.SetEnvironmentVariable ("MLAUNCH_PATH", filename);
197-
return mlaunch = filename;
198-
}
199-
200-
// Then check if we can download mlaunch.
201-
Log ("Could not find a locally built mlaunch, will try downloading it.");
202-
try {
203-
filename = DownloadMlaunch ();
204-
} catch (Exception e) {
205-
Log ("Could not download mlaunch: {0}", e);
206-
}
207-
if (File.Exists (filename)) {
208-
Log ("Found mlaunch: {0}", filename);
209-
Environment.SetEnvironmentVariable ("MLAUNCH_PATH", filename);
210-
return mlaunch = filename;
211-
}
212-
213-
// Then check if the system version of Xamarin.iOS has mlaunch.
214-
// This may be a version of mlaunch we're not compatible with, since we don't control which XI version the system has.
215-
Log ("Could not download mlaunch, will try the system's Xamarin.iOS.");
216-
filename = "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch";
217-
if (File.Exists (filename)) {
218-
Log ("Found mlaunch: {0}", filename);
219-
Environment.SetEnvironmentVariable ("MLAUNCH_PATH", filename);
220-
return mlaunch = filename;
221-
}
222-
223-
throw new FileNotFoundException (string.Format ("Could not find mlaunch: {0}", filename));
224-
}
225-
226-
return mlaunch;
190+
return Path.Combine (IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current", "bin", "mlaunch");
227191
}
228192
}
229193

tools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
TOP=..
2-
SUBDIRS=mmp mtouch install-source
2+
SUBDIRS=mmp mtouch install-source mlaunch
33
include $(TOP)/Make.config

tools/mlaunch/Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
TOP=../..
2+
3+
include $(TOP)/Make.config
4+
5+
COLOR_GREEN:=$(shell tput setaf 120 2>/dev/null)
6+
COLOR_CLEAR:=$(shell tput sgr0 2>/dev/null)
7+
8+
ifdef ENABLE_XAMARIN
9+
all-local install-local::
10+
$(MAKE) -C $(MACCORE_PATH)/tools/mlaunch $@
11+
else
12+
all-local install-local::
13+
$(Q) cp -R $(MACIOS_BINARIES_PATH)/mlaunch/bin/mlaunch $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin
14+
$(Q) cp -R $(MACIOS_BINARIES_PATH)/mlaunch/lib/mlaunch $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib
15+
endif
16+
17+
ifdef ENABLE_XAMARIN
18+
publish:
19+
$(Q) mkdir -p $(MACIOS_BINARIES_PATH)/mlaunch/bin
20+
$(Q) mkdir -p $(MACIOS_BINARIES_PATH)/mlaunch/lib
21+
$(Q) cp -R $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch $(MACIOS_BINARIES_PATH)/mlaunch/bin
22+
$(Q) cp -R $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mlaunch $(MACIOS_BINARIES_PATH)/mlaunch/lib
23+
$(Q) cd $(MACIOS_BINARIES_PATH) && git add mlaunch && git commit -q -m "Bump mlaunch to xamarin/maccore@$(shell cd $(MACCORE_PATH) && git log -1 --pretty=%h)" && git log -1 --pretty=short
24+
$(Q) echo "$(COLOR_GREEN)A new version of mlaunch has been copied to $(MACIOS_BINARIES_PATH), and a commit created with the new version.$(COLOR_CLEAR)"
25+
$(Q) echo "$(COLOR_GREEN)Please create pull request in the macios-binaries repository for the new mlaunch version, and once merged, bump the submodule in xamarin-macios.$(COLOR_CLEAR)"
26+
else
27+
publish:
28+
@echo "Can't publish mlaunch binaries to the macios-binaries repository unless building mlaunch from source (by enabling the xamarin build)"
29+
@exit 1
30+
endif

tools/mlaunch/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
mlaunch
2+
-------
3+
4+
mlaunch is a closed source tool used to interact with simulators and devices.
5+
6+
We'll build this tool from souce if the xamarin build is enabled (configured
7+
with --enable-xamarin).
8+
9+
Otherwise we'll get a binary version from the macios-binaries repository. This
10+
version may be somewhat out of date, but should work at least for running
11+
tests.
12+
13+
To update the binary version of mlaunch in macios-binaries execute `make publish`
14+
in this directory (when the xamarin build is enabled, so that mlaunch
15+
is built from source).

0 commit comments

Comments
 (0)