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

Add Tizen backend #1546

Merged
merged 8 commits into from
Jul 12, 2018
Merged

Add Tizen backend #1546

merged 8 commits into from
Jul 12, 2018

Conversation

rookiejava
Copy link
Contributor

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
There is no tizen as a backend platfom of ReactiveUI

What is the new behavior (if this is a feature change)?
Tizen has been added as a backend platform of ReactiveUI

What might this PR break?
None

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:
This PR is a latest revision of #1387. And, this PR contains only the minumum requrirements to support Tizen. So, implementations that need to work correctly (like android, iOS), should be required through different PRs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 69.619% when pulling 8beb63a on rookiejava:add-tizen into a20157d on reactiveui:develop.

@ghuntley
Copy link
Member

ghuntley commented Dec 7, 2017

Howdy @rookiejava thank-you so much for your contribution. I've noticed on your github profile that you have done some work on the tizen platform before. How well do you know the platform? Do you work at Samsung? We are looking for a platform lead. I'm happy to work with you, pair with you and video call with you to discuss the broader picture. Last I was aware was that .net ++ tizen was immature and it wasn't possible to actually target the platform with nuget (even though the tfm is defined) - has this changed?

@ghuntley ghuntley self-assigned this Dec 7, 2017
@ghuntley ghuntley added the tizen label Dec 7, 2017
@rookiejava
Copy link
Contributor Author

@ghuntley Yes. The latest vesrion of Tizen (Tizen 4.0 M2), that offially supports .NET, was released in the last month. For more details, see https://developer.tizen.org/tizen/release-notes/tizen-4.0-public-m2.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 69.619% when pulling 3201e27 on rookiejava:add-tizen into a20157d on reactiveui:develop.

@ghuntley
Copy link
Member

ghuntley commented May 11, 2018

@rookiejava and @ideallee we are looking for two people (you?!) to join the core team of ReactiveUI and help shape the future of Tizen. See https://reactiveui.net/team/ for specifics and if this is of interest to please join us over in https://reactiveui.net/slack at https://reactivex.slack.com/archives/CAK67UA7M/p1526040674000046

Tizen is something we really want to add in Splat, ReactiveUI and Akavache. Let's do it (soon - like next release?)

ReactiveUI is a composable, cross-platform model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming which is a paradigm that allows you to express the idea around a feature in one readable place, abstract mutable state away from your user interfaces and improve improve the testability of your application.

@ghuntley ghuntley changed the base branch from develop to master May 17, 2018 10:17
@ghuntley ghuntley requested review from a team May 17, 2018 10:18
@rookiejava rookiejava requested a review from a team May 17, 2018 12:37
@ghuntley
Copy link
Member

This branch has been updated and is almost ready for merge. I'm having some difficulties with EventGenerator and tizen. Any help would be appreciated. Parking this for now.

Repro:

./build.cmd

src/EventBuilder/ is the code generator for src/ReactiveUI.Events/Events_TIZEN.cs

@rookiejava
Copy link
Contributor Author

rookiejava commented May 28, 2018

@ghuntley As for this issue, I and my colleague (@WonyoungChoi) took a look inside what happend. And we found there is a bug on EventTenplateInformation class. It seems that it doesn;t work correctly in case of genereic instance type.

var generic = ei.EventType as GenericInstanceType;
if (generic != null) {
foreach (
var kvp in
type.GenericParameters.Zip(generic.GenericArguments, (name, actual) => new { name, actual })) {
var realType = GetRealTypeName(kvp.actual);
ret = ret.Replace(kvp.name.FullName, realType);
}

According to above logic, if real type name contains kvp name ('T', 'U', 'R'), it replaced into real type name. As a result, the below 2 cases replaced unintended.

  • IObservable<Tizen.NUI.UIComponents.Slider.MarkReachedEventArgs> MarkReached

    • MarkReachedEventArgs turned into MarkBooleaneachedEventArgs
      • (R => Boolean)
  • Observable<Tizen.NUI.ImfManager.EventReceivedEventArgs>

    • EventReceivedEventArg turned into EventTizen.NUI.ImfManager.EventeceivedEventArg
      • (R => Tizen.NUI.ImfManager.Event)

Obviously, this is not a bug on only for Tizen, but everywhere. So, I'd like to recomend

a) fix EventTemplateInformation correctly for generic instance type
b) ignore these 2 exceptional cases as for now (even if temporaily way)

@rookiejava
Copy link
Contributor Author

I've tweaked it a little bit and build successfully.

Copy link
Member

@olevett olevett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One extra little change I think is worth doing, can you add to the Directory.build.targets an entry for tizen, even if it doesn't do anything at the moment?

{"System.Boolean`1", "Boolean"},


{"System.EventHandler", "EventHandler"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the tizen40 comment is that clear, or necessarily adds that much

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I did not make this change, but I've fixed unnecessary blanks and comments.

{"Tizen.NUI.EventHandlerWithReturnType`1", "Tizen.NUI.EventHandlerWithReturnType"},
{"Tizen.NUI.EventHandlerWithReturnType`2", "Tizen.NUI.EventHandlerWithReturnType"},
{"Tizen.NUI.EventHandlerWithReturnType`3", "Tizen.NUI.EventHandlerWithReturnType"},

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not make this change, but I've fixed unnecessary blanks and comments.

};

private static string RenameBogusWinRTTypes(string typeName)
private static string RenameBogusTypes(string typeName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -43,7 +65,12 @@ private static string GetEventArgsTypeForEvent(EventDefinition ei)
type.GenericParameters.Zip(generic.GenericArguments, (name, actual) => new { name, actual })) {
var realType = GetRealTypeName(kvp.actual);

ret = ret.Replace(kvp.name.FullName, realType);
var temp = ret.Replace(kvp.name.FullName, realType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I quite get this change, shouldn't we be replacing type names for multiple generic type arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix to resolve the potential issues (to avoid unintended replacement) mentioned above with minimal changes. It's nothing more, nothing less.


var elmSharp = Directory.GetFiles(packageUnzipPath, "ElmSharp*.dll", SearchOption.AllDirectories);

foreach (var assembly in elmSharp) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assemblies.AddRange(elmSharp);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not make this change, but I've updated it anyway.

(exception, timeSpan, context) => {
Log.Warning(
"An exception was thrown whilst retrieving or installing {packageName}: {exception}",
_packageName, exception);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string interpolations here (and ln22 and ln42) need a $ at the start of the string, e.g. ln 58.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not make this change, but I've fixed anyway.

@rookiejava
Copy link
Contributor Author

@olevett I've also added tizen to Directory.build.targets. Thank you.

@rookiejava
Copy link
Contributor Author

@ghuntley could you review and merge this?

@olevett olevett merged commit e3eb8ef into reactiveui:master Jul 12, 2018
@olevett
Copy link
Member

olevett commented Jul 12, 2018

Thanks @rookiejava!

@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants