Граф коммитов

746 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Peppers 9cd5d13e8c
VS 2019 Refresh (#739)
* Setup Azure DevOps for CI
  * Install Android NDK Bundle on Windows build agents
  * Workaround for `JAVA_HOME` on Windows build agents
* Support for Android NDK r19 and r20
* Updated Cake scripts to support VS 2019 on Windows
* Pin NuGet download URL to v4.7.3
* Bump to xamarin/xamarin-android-tools/master@294f447
  * Changes: 4c00c22...294f447
* Fix for `mono-support.h` on Windows

Fixes:

    c:\program files (x86)\mono\include\mono-2.0\mono\utils\mono-publib.h(94): error C2371: 'mono_unichar2': redefinition; different basic types [D:\a\1\s\tests\common\mk\common.Tests.vcxproj]
2019-09-09 16:23:22 -05:00
Jonathan Peppers c237e21b63 [build] changes to fix the CI
Context: https://travis-ci.org/mono/Embeddinator-4000/jobs/471012684
Context: https://travis-ci.org/mono/Embeddinator-4000/jobs/471026456
Context: https://travis-ci.org/mono/Embeddinator-4000/jobs/471037351

First issue we are hitting is a missing version of Cake on MyGet:

    Unable to find version '0.23.0' of package 'Cake'.
      https://www.myget.org/F/cake/api/v3/index.json: Package 'Cake.0.23.0' is not found on source 'https://www.myget.org/F/cake/api/v3/index.json'.

To fix this:

- Let's remove `MyGet.config` and just use NuGet
- Update Cake to 0.31, I recently used that version on another project

Next issue is that the build will not work using JDK 10:

    Compiling binding code...
        Invoking: /usr/libexec/java_home
            /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
        Invoking: /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/javac
    ...
    Fatal Error: Unable to find package java.lang in classpath or bootclasspath

To fix this we should use the `-v 1.8` switch on every call to `java_home`.

Next issue is that we aren't specifying a version with the `#tool`
directive:

    The 'tool' directive is attempting to install the 'NUnit.ConsoleRunner' package
    without specifying a package version number.

After that we were hitting issues where Xamarin.iOS\Mac\Mono were having trouble being provisioned, so I bumped them all to current stable.

Then a few test fixes, including some from https://github.com/mono/Embeddinator-4000/pull/714 originally.

This fixes Jenkins and part fixes the other builds. @jonathanpeppers will look at those later
2018-12-21 18:01:16 -05:00
Jonathan Peppers d697cdfca5
[windows] .gitattributes for proper line endings settings (#667)
Context: https://help.github.com/articles/dealing-with-line-endings/

If you work on this repo on Windows, you quickly see the `.gitattributes` are not setup right for development on Windows.

1. Certain files had mixed line endings, which causes Visual Studio to prompt to adjust.

2. Running `premake` yields Windows line endings on Windows, and so every `*.csproj` file appears to have changes.

`xamarin-android` has a well-used `.gitattributes` file, so I used it as a starting point and added an entry for `*.cake` files.

The way it works (as I understand it):
- `git` stores everything with unix line endings
- on checkout, clients convert the line endings according to settings in the `.gitattributes` file

So, for example:
- All `*.csproj` files will have Windows line endings, as Visual Studio expects (both Mac and Windows)
- `*.cs` files will have Windows line endings on Windows, and unix line endings on Mac
2018-05-04 17:06:07 -05:00
Jonathan Peppers d5fed87456
[build] Android API 26, setup Windows builds on Jenkins (#664)
- `Download-Xamarin-Android` needs to "copy" from temp, since the bots have temp in `D:\` and you can't do a "move" operation across drives
- Added a `Jenkins` cake target to replace `AppVeyor`
- Switch to Android API Level 26 and `TargetFrameworkVersion` v8.0 by default. Jenkins PR bots did not have an option to provision API 24.
- Updated to Android Support Libs 26.x

Changes for latest Android Studio + Windows 
- Updated `.gitignore`
- Removed files we don't need to check into source control
- Changed option for max heap size that was erroring on Windows
- Use `--stacktrace` option when running gradle, so we get error messages
- Updated Android test project to API 26, and support lib 26.x

TODO in future PRs:
- Drop everything that says "AppVeyor"
2018-04-27 15:10:46 -05:00
Jonathan Peppers 6f6560672d
[java] better logic for finding path to Java (#662)
One of the most common issues Windows developers face when using E4K is a message such as:

    Cannot find Java SDK: JAVA_HOME environment variable is not set.

In fact, most Windows users don't set `JAVA_HOME` at all, since it is not something done system-wide by any installer.

Solution? Let's add a fallback to use `AndroidSdk.JavaSdkPath`.

`AndroidSdk` from `xamarin-android-tools` has very reliable logic for finding Java on all platforms. However, we haven't been using it in E4K for locating Java, because it _implicitly_ requires the Android SDK (see class name) be installed in order to work. See where `AndroidSdkInfo` throws here: b159597b15/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs (L23)

Using it as a last resort will make things alot simpler for our Windows users. If they have Xamarin.Android installed from VS 2017, everything will "Just Work".
2018-04-25 15:24:45 -05:00
Chris Hamons b41ff2b7ae Throw nice exception instead of NRE when XA not installed 2018-03-02 10:20:40 -06:00
Jonathan Peppers 59220f07e4
Merge pull request #584 from jonathanpeppers/mscorlib-duplicates
[android] Improvements to Resource.designer.dll generation
2018-01-27 15:32:59 -06:00
Joao Matos e380954abc [java] Fixed generation conflict with properties and methods starting with get/set.
Fixes https://github.com/mono/Embeddinator-4000/issues/580.
2018-01-26 10:20:53 +00:00
Jonathan Peppers dad7331d39 Improvements to Resource.designer.dll generation
Fixes #582

- Added a test case to repro #582
- Improved upon `System.CodeDom` logic, to use more specific type names
via `CodeTypeReference` instead of strings
- no longer need `using System;`
- Improved upon the number of assemblies that `Resource.designer.dll`
references. We only need to reference input assemblies that contain
`Resource` classes generated by Xamarin.Android.
- Updated approval tests to match the new generated code
2018-01-25 23:42:48 -06:00
Joao Matos 1e5ca322d0 [java] Fixes Java generation for primitive pointer types.
Fixes https://github.com/mono/Embeddinator-4000/issues/571.
2018-01-25 23:23:28 +00:00
Joao Matos 182ff98330 Simplify some code. 2018-01-25 23:20:32 +00:00
Joao Matos 06bc9245de Fixed Java generation for long literals in enums.
Fixes https://github.com/mono/Embeddinator-4000/issues/573.
2018-01-25 21:40:46 +00:00
Joao Matos 93d9804c90 [c] Ignore unsupported types when checking for array types.
Fixes https://github.com/mono/Embeddinator-4000/issues/545.
2017-11-28 15:42:12 +00:00
Joao Matos accc39e30b [java] Fixes for String type mismatches and invalid toString() overloads.
Fixes https://github.com/mono/Embeddinator-4000/issues/550.
2017-11-28 14:22:25 +00:00
Joao Matos 9d34d722b0 [java] Fixed a bug generating a method name getClass() in Java. 2017-11-28 13:24:52 +00:00
Joao Matos c9d4a7d432 Remove unused pass. 2017-11-28 13:24:52 +00:00
Joao Matos 70624492fb [java] Check and rename forbidden declaration names (getClass() for now). 2017-11-24 17:44:25 +00:00
Joao Matos 46e47ca2c8 [java] Rename getters/setters to Java convention on generation. 2017-11-24 17:43:56 +00:00
Joao Matos 76e6966a1c [binder] Fixed ManagedQualifiedName for non-synthetized property acessors. 2017-11-24 15:25:40 +00:00
Joao Matos 6f15d927fb [binder] GetRootAssociatedDecl is now an extension method. 2017-11-24 15:24:51 +00:00
Joao Matos 4e7f9441e2 [binder] Remove non-generated declarations earlier in declaration checking. 2017-11-24 14:45:57 +00:00
Joao Matos a8249b44bc [binder] Moved reserved keywords checking pass to another namespace. 2017-11-24 14:34:34 +00:00
Joao Matos 101093aee0 [java] Rewrite method identifier method to handle more cases. 2017-11-24 14:34:06 +00:00
Joao Matos f6c41ef7bd [ast] Rewrite managed declaration name logic to be more general. 2017-11-24 14:33:44 +00:00
Joao Matos ca1ca1458b [binder] Field to property pass created methods now reference the property. 2017-11-24 14:32:17 +00:00
Joao Matos 2341e9e11e [binder] Re-work order of passes. 2017-11-24 14:31:35 +00:00
Joao Matos 8bc9ea866f [binder] Re-write the pass to check declarations names for duplicates. 2017-11-24 14:31:02 +00:00
Joao Matos 88b57de009 [java] Rework how method name generation is done in Java. 2017-11-23 17:01:46 +00:00
Joao Matos f243597dea [c] Rework how method name generation is done in C. 2017-11-23 17:01:46 +00:00
Joao Matos 22ffe670a2 [ast] Improve ManagedQualifiedName to deal correctly with synthetic fields acessors. 2017-11-23 17:01:46 +00:00
Joao Matos 4f05650d00 [binder] Associate the created properties and fields in FieldToGetterSetter. 2017-11-23 17:01:46 +00:00
Joao Matos 0f830b32f1 [ast] Unmangling of type names can now deal with explicit interface names. 2017-11-23 17:01:46 +00:00
Joao Matos 9e84f9fe1c [ast] Property acessors now track their relative property as associated declarations. 2017-11-23 17:01:46 +00:00
Joao Matos 97c7ae6b10 Update CppSharp to latest revision. 2017-11-23 17:01:46 +00:00
Joao Matos a4dac13389 Re-work how managed properties are stored in the AST and visiting behavior.
We now only store top-level property AST nodes instead of getter/setter nodes attached to leaf nodes.
2017-11-23 17:01:46 +00:00
Joao Matos de7d37fb2b [ast] Store managed names for fields and properties. 2017-11-23 17:01:46 +00:00
Joao Matos d87fd57a8c [build] Pass -Wno-typedef-redefinition to compiler to reduce warnings. 2017-11-23 17:01:46 +00:00
Joao Matos 4925a5c522 [binder] Wrap long line. 2017-11-23 17:01:46 +00:00
Jonathan Peppers de31e4ff88 [android] update latest 15-4 stable branch of Xamarin.Android
MSBuild tasks changed a bit:
- Aapt needs to conditionally run if there are no resources
- ResolveLibraryProjectImports had changes to required properties
- Using shorter names for intermediate directories

Other changes:
- Xamarin.Android’s mono.android.Runtime.init had API changes.
- URLs in cake script to download 15-4 build artifact from Jenkins
- AppVeyor cache should watch for `build\Android.cake` changes

After this PR, I'll look at getting API-26 support as the default.
2017-11-10 15:54:56 -05:00
Joao Matos ceb91dedb5 [binder] Simplify C marshaling code. 2017-11-07 14:57:13 +00:00
Joao Matos dcf8a8ac76 [binder] Rename language marshalers to new convention. 2017-11-07 14:51:34 +00:00
Joao Matos ef0c700385 [binder] Rename MarshalPrinter class to Marshaler. 2017-11-07 14:51:34 +00:00
Joao Matos f3a747b14a [binder] Remove unused MarshalPrinter members. 2017-11-07 14:51:34 +00:00
Joao Matos 79c89bcade [binder] Remove MarshalContext from marshalers type hierarchy. 2017-11-07 14:51:34 +00:00
Joao Matos 3c3aa90237 [binder] Simplify the name for marshaling before/after text generators. 2017-11-07 14:51:34 +00:00
Joao Matos 4a3d186528 [swift] Initial implementation of marshaling for main types. 2017-11-06 18:29:49 +00:00
Joao Matos c262cb580c [swift] Initial implementation of native object field declaration. 2017-11-06 18:28:47 +00:00
Joao Matos bacfb9b20d [swift] Initial implementation of native function invocation and marshaling. 2017-11-06 18:28:14 +00:00
Joao Matos e856d28d65 [swift] Use non-deprecated UnsafeRawPointer type to represent untyped native pointers. 2017-11-06 18:26:10 +00:00
Joao Matos 76c3b9c15b [c/swift] Remove dead primitive type printing code. 2017-11-06 18:25:30 +00:00