-
Notifications
You must be signed in to change notification settings - Fork 55
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
Conversation
…on of the currently IL-only features.
…tic (via generics).
…ces (excluding IWrappedMethod).
…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.
…into XamlX-rename
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. |
@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. |
@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. |
@jkoritzinsky I think we need to do a |
Mkay, in this universe Oceania had always been at war with Eastasia |
I’m good with us doing a filter-branch style renaming. |
Force-pushed to https://github.com/kekekeks/XamlIl/tree/xamlx-rename with commit messages rewritten as well for the greater glory of Ingsoc. |
I highly appreciate the 1984 references haha. Let’s go with your branch. |
Rename utility that was used for 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. |
I'll give it a shot. The command would be |
I was using a separate bash script that looks like
You can change the script by hardcoding those values and using the current directory instead of the first command line arg. |
Superseded by #11 |
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.