Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xamarin-analysis] Add rule #6 and updated md file #3088

Merged
merged 1 commit into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/website/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ WEBSITE_DOCS ?= $(TOP)/documentation
XAMARIN_ANALYSIS ?=$(TOP)/xamarin-analysis/shared/Xamarin.Analysis
XAMARIN_ANALYSIS_DOC = xamarin-analysis-doc-tool/bin/Debug

diff:
-diff -u $(WEBSITE_DOCS)/guides/ios/troubleshooting/mtouch-errors/index.md mtouch-errors.md
-diff -u $(WEBSITE_DOCS)/guides/cross-platform/macios/binding/objective-c-libraries/index.md binding_objc_libs.md
-diff -u $(WEBSITE_DOCS)/guides/cross-platform/macios/binding/binding-types-reference/index.md binding_types_reference_guide.md
-diff -u $(WEBSITE_DOCS)/guides/ios/troubleshooting/xamarin-ios-analysis/index.md xamarin-ios-analysis.md

all: xamarin-analysis-doc
cp mtouch-errors.md $(WEBSITE_DOCS)/guides/ios/troubleshooting/mtouch-errors/index.md
cp binding_objc_libs.md $(WEBSITE_DOCS)/guides/cross-platform/macios/binding/objective-c-libraries/index.md
cp binding_types_reference_guide.md $(WEBSITE_DOCS)/guides/cross-platform/macios/binding/binding-types-reference/index.md
cp xamarin-ios-analysis.md $(WEBSITE_DOCS)/guides/ios/troubleshooting/xamarin-ios-analysis/index.md

diff:
-diff -u $(WEBSITE_DOCS)/guides/ios/troubleshooting/mtouch-errors/index.md mtouch-errors.md
-diff -u $(WEBSITE_DOCS)/guides/cross-platform/macios/binding/objective-c-libraries/index.md binding_objc_libs.md
-diff -u $(WEBSITE_DOCS)/guides/cross-platform/macios/binding/binding-types-reference/index.md binding_types_reference_guide.md
-diff -u $(WEBSITE_DOCS)/guides/ios/troubleshooting/xamarin-ios-analysis/index.md xamarin-ios-analysis.md

xamarin-analysis-doc:
msbuild xamarin-analysis-doc-tool/xamarin-analysis-doc.sln
mono $(XAMARIN_ANALYSIS_DOC)/xamarin-analysis-doc.exe $(XAMARIN_ANALYSIS)/Xamarin.iOS.Analysis.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ static void GenerateAnalysisDoc (string path)
section += "[//]: # (The original file resides under https://github.com/xamarin/xamarin-macios/tree/master/docs/website/)\n";
section += "[//]: # (This allows all contributors (including external) to submit, using a PR, updates to the documentation that match the tools changes)\n";
section += "[//]: # (Modifications outside of xamarin-macios/master will be lost on future updates)\n\n";
section += "Xamarin.iOS analysis is a set of rules that check your project settings to help you determine if better/more optimized settings are available.\n\n";
section += "Run the analysis rules as often as possible to find possible improvements early on and save development time.\n\n";
section += "To run the rules, in Visual Studio for Mac's menu, select **Project > Run Code Analysis**.\n\n";
section += "> ⚠️ **NOTE:** Xamarin.iOS analysis only runs on your currently selected configuration. We highly recommend running the tool for debug **and** release configurations.\n\n";

var root = XDocument.Load (path);

Expand Down
22 changes: 18 additions & 4 deletions docs/website/xamarin-ios-analysis.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
---
id: C29B69F5-08E4-4DCC-831E-7FD692AB0886
title: "Xamarin.iOS Analysis Rules"
dateupdated: 2017-06-26
id: c29b69f5-08e4-4dcc-831e-7fd692ab0886
title: Xamarin.iOS Analysis Rules
dateupdated: 2017-12-07
---

[//]: # (The original file resides under https://github.com/xamarin/xamarin-macios/tree/master/docs/website/)
[//]: # (This allows all contributors (including external) to submit, using a PR, updates to the documentation that match the tools changes)
[//]: # (Modifications outside of xamarin-macios/master will be lost on future updates)

Xamarin.iOS analysis is a set of rules that check your project settings to help you determine if better/more optimized settings are available.

Run the analysis rules as often as possible to find possible improvements early on and save development time.

To run the rules, in Visual Studio for Mac's menu, select **Project > Run Code Analysis**.

> ⚠️ **NOTE:** Xamarin.iOS analysis only runs on your currently selected configuration. We highly recommend running the tool for debug **and** release configurations.

### <a name="XIA0001"/>XIA0001: DisabledLinkerRule

- **Problem:** The linker is disabled on device for the debug mode.
Expand All @@ -31,5 +39,11 @@ To set it up, go to Project > iOS Build > Linker Behavior.

### <a name="XIA0005"/>XIA0005: Float32Rule

- **Problem:** Not using the float32 option (--aot-options=-O=float32) leads to hefty performance cost, specially on mobile, where double precision math is measurably slower. Note that .NET uses double precision internally, even for float, so enabling this option affects precision and, possibly, compatibility.
- **Problem:** Not using the float32 option (--aot-options=-O=float32) leads to hefty performance cost, especially on mobile, where double precision math is measurably slower. Note that .NET uses double precision internally, even for float, so enabling this option affects precision and, possibly, compatibility.
- **Fix:** Double click on your iOS project, go to Build > iOS Build and uncheck the "Perform all 32-bit float operations as 64-bit float".

### <a name="XIA0006"/>XIA0006: HttpClientAvoidManaged

- **Problem:** We recommend using the native HttpClient handler instead of the managed one for better performance, smaller executable size, and to easily support the newer standards.
- **Fix:** Double click on your iOS project, go to Build > iOS Build and change the HttpClient implementation to either NSUrlSession (iOS 7+) or CFNetwork to support version preceding iOS 7.

2 changes: 1 addition & 1 deletion mk/xamarin.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ifdef ENABLE_XAMARIN
NEEDED_MACCORE_VERSION := c3913ff3ab308ab9aa741e0ccd3df602d5754ff5
NEEDED_MACCORE_VERSION := a2f9f44167c11f71ca9c210118fe88c69f4a1869
NEEDED_MACCORE_BRANCH := master

MACCORE_DIRECTORY := maccore
Expand Down