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

Rename XamlIL to XamlX and refactor out the hard IL dependencies. #10

Closed
wants to merge 22 commits into from
Closed

Rename XamlIL to XamlX and refactor out the hard IL dependencies. #10

wants to merge 22 commits into from

Conversation

jkoritzinsky
Copy link
Collaborator

Rename XamlIL -> XamlX. Refactor out base classes for the compilers for 3 built-in compiler types, declarative, imperative, and IL (each builds on previous). Make the backend generic on the "raw" emitter and the result type returned by the node emitters.

Keep support for implementing emit for specific backends on the node types themselves while also supporting using emitter objects exclusively.

Contributes to #8.

jkoritzinsky and others added 22 commits October 30, 2019 23:00
…ic and enable external emitter classes for wrapped methods and property setters.
…arative AST to an imperative AST and the basic infrastructure behind the "Populate/Build method pair" can be shared easily.
…r instead of as part of NewObjectTransformer.
@rcollina
Copy link

I can't seem to find a nuget package for this project. I'd love to use Xaml in .NET Core for x-plat applications.

@kekekeks
Copy link
Owner

kekekeks commented Jan 28, 2020

@rcollina For now it's supposed to be included as a git submodule since the API isn't really stable at all. You also will have to use ILRepack to get it merged into your MSBuild task anyway.

@jkoritzinsky
Copy link
Collaborator Author

@kekekeks can you review this when you have a chance? I'd like to eventually get this merged in so we can update Avalonia and work on sharing more phases.

@kekekeks
Copy link
Owner

@jkoritzinsky I think we need to do a filter-branch-based rename and re-apply your refactoring...

@kekekeks
Copy link
Owner

Mkay, in this universe Oceania had always been at war with Eastasia

@jkoritzinsky
Copy link
Collaborator Author

I’m good with us doing a filter-branch style renaming.

@kekekeks
Copy link
Owner

kekekeks commented Jan 28, 2020

Force-pushed to https://github.com/kekekeks/XamlIl/tree/xamlx-rename with commit messages rewritten as well for the greater glory of Ingsoc.

@jkoritzinsky
Copy link
Collaborator Author

I highly appreciate the 1984 references haha. Let’s go with your branch.

@kekekeks
Copy link
Owner

kekekeks commented Jan 28, 2020

Rename utility that was used for --tree-filter

        static int Main(string[] args)
        {
            if (args.Length != 3)
            {
                Console.Error.WriteLine("Usage: app <target> <oldname> <newname>");
                return 1;
            }

            var target = args[0];
            var oldNameString = args[1];
            var newNameString = args[2];

            void Do(string path)
            {
                foreach (var f in Directory.GetFiles(path))
                {
                    var name = Path.GetFileName(f);
                    var newName = name.Replace(oldNameString, newNameString);
                    var newPath = Path.Combine(path, newName);
                    if (name != newName)
                    {
                        Console.WriteLine($"Renaming {f} to {newName}");
                        File.Move(f, newPath);
                    }
                    Console.WriteLine($"Replacing text in {newPath}");
                    File.WriteAllText(newPath, File.ReadAllText(newPath).Replace(oldNameString, newNameString));
                }

                foreach (var d in Directory.GetDirectories(path))
                {
                    var name = Path.GetFileName(d);
                    if(name.StartsWith(".git"))
                        continue;
                    var newName = name.Replace(oldNameString, newNameString);
                    var newPath = Path.Combine(path, newName);
                    if (name != newName)
                    {
                        Console.WriteLine($"Renaming {d} to {newName}");
                        Directory.Move(d, newPath);
                    }

                    Do(newPath);
                }
            }
            Do(target);

            return 0;
        }

Might be worth to apply it to PR commits so they could be cherry-picked more easily.

@jkoritzinsky
Copy link
Collaborator Author

I'll give it a shot. The command would be git filter-branch --tree-filter "ConsoleApp.exe XamlIL XamlX" where ConsoleApp is your utility script correct?

@kekekeks
Copy link
Owner

I was using a separate bash script that looks like

#!/bin/bash
dotnet /path/to/app.dll `pwd` XamlIl XamlX
dotnet /path/to/app.dll `pwd` XamlIL XamlX

You can change the script by hardcoding those values and using the current directory instead of the first command line arg.

@jkoritzinsky
Copy link
Collaborator Author

Superseded by #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants