Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Pryor jonpryor

View GitHub Profile
View X.targets
<Project>
<PropertyGroup>
<InvalidVersion>1.2.3a4</InvalidVersion>
<IsValid Condition="$([System.Version]::TryParse(
'$(InvalidVersion)',
$([System.Version]::Parse('1.2.3.4'))
))">True</IsValid>
</PropertyGroup>
<Target Name="Foo">
<Message Text="IsValid=$(IsValid)" Importance="High" />
View X.targets
<Project>
<PropertyGroup>
<IsNet6IosCompatibleWithNet6 Condition="$([MSBuild]::IsTargetFrameworkCompatible('net6.0', 'net6.0-ios'))">Yes</IsNet6IosCompatibleWithNet6>
</PropertyGroup>
<Target Name="Foo">
<Message Text="IsNet6IosCompatibleWithNet6=$(IsNet6IosCompatibleWithNet6)" />
</Target>
</Project>
View NdkUtils.cs.diff
diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/NdkUtils.cs b/src/Xamarin.Android.Build.Tasks/Tasks/NdkUtils.cs
index e4548923d..851e4fb83 100644
--- a/src/Xamarin.Android.Build.Tasks/Tasks/NdkUtils.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tasks/NdkUtils.cs
@@ -12,6 +12,7 @@ using Microsoft.Build.Utilities;
using Java.Interop.Tools.Diagnostics;
using Xamarin.Android.Tools;
+using Microsoft.Android.Build.Tasks;
View app.cs
using System;
using System.IO;
class App {
public static void Main (string[] args)
{
foreach (var file in args) {
var content = File.ReadAllText (file);
var lines = content.Split ('\n');
foreach (var line in lines) {
View tuples-and-linq.cs
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
var markers = new[]{
(a: 1, s: "a"),
View extract-native-libraries.md

Installation of Native Libraries

An Android .apk file can contain native libraries for one or more architectures. Historically, all native libraries for the target device are extracted at .apk installation time. This would result in two copies of native libraries on the target device: a set of native libraries which are stored compressed within the .apk, and a separate set of native libraries on the Android target filesystem.

Starting with Android v6.0 (API-23), Android added an ability for

View Scratch.Gxa1704-log.txt
This file has been truncated, but you can view the full file.
1>------ Skipped Build: Project: NativeLibrary, Configuration: Debug x86 ------
1>Project not selected to build for this solution configuration
2>Project 'Scratch.Gxa1704' is not up to date. Missing output file 'C:\Users\jopryo\source\repos\Scratch.Gxa1704\Scratch.Gxa1704\bin\Debug\Scratch.Gxa1704.dll'.
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the NuGet Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
Running restore with 8 concurrent jobs.
Reading project file C:\Users\jopryo\source\repos\Scratch.Gxa1704\Scratch.Gxa1704\Scratch.Gxa1704.csproj.
Restoring packages for C:\Users\jopryo\source\repos\Scratch.Gxa1704\Scratch.Gxa1704\Scratch.Gxa1704.csproj...
Restoring packages for MonoAndroid,Version=v8.1...
View st.cs
// switch on type?
using System;
class App {
public static void Main ()
{
sbyte v;
if (TryConvert (42.0, out v)) {
Console.WriteLine ($"v={v}");
}
View classes.xml
<api
api-source="class-parse">
<package
name="android.support.v7.recyclerview.extensions"
jni-name="android/support/v7/recyclerview/extensions">
<class
abstract="false"
deprecated="not deprecated"
jni-extends="Ljava/lang/Object;"
extends="java.lang.Object"