Open yodantauber opened 10 years ago
It should be, but I'll test that and get back to you...
The ImportGroupChildren route is empty and there is no memberroute for "Import".
This leads props { Import {}} to be taken as a
Ah, yeah. I'm out of town this week, I'll try to fix this next week when I get back
Great ! Thanks for the quick reply ! This would be a great addition.
Is there any news regarding this? I would love to be able to import external .props / .targets files into consuming projects.
In ProjectPlus.cs, I implemented ImportGroupChildren
like this:
private IEnumerable<ToRoute> ImportGroupChildren {
get {
yield return "".MapTo<ProjectImportGroupElement>((parent, view) =>
{
return new ListWithAction<string>(s =>
{
// when an item is added
parent.AddImport(s);
});
});
}
}
In PackageScriptTemplate.autopkg, I added this in the files
section:
import_targets += {
#add-each-file : _targets.ImportGroup.MyTargetImports;
#destination : ${build_root}/imports/${conditionFolder};
};
import_props += {
#add-each-file : ::nuget.props.[ ${condition} ].ImportGroup.MyPropImports;
#destination : ${build_root}/imports/${conditionFolder};
};
Then, in any autopkg script, import_props
and import_targets
can be used like this (in the files
section):
[x64] { import_targets: my_x64_file.targets; }
[win32] { import_props: my_win32_file.props; }
Should this work in 1.23.521.0?
I have the same property sheet for all configurations so I tried
files {
import_props: ..\build\bsii.props;
}
This added the property sheet to the package but when I install it on a project the project sheet is not imported. Adding the [Win32] choice doesn't work either.
When I added both
import_props += {
#add-each-file : ::nuget.props.[ ${condition} ].ImportGroup.MyPropImports;
#destination : ${build_root}/imports/${conditionFolder};
};
and
import_props: ..\build\bsii.props;
Then something got installed on the project but it wasn't my property sheet but another one that was generated by CoApp "build\native\bsii.foundations.propertysheets.props" and doesn't contain any redirection to my property sheet.
Also, my property sheet contains redirections to other property sheets. Is it possible to include all of them in the package? I managed adding them to the package using
import_props += {
#destination = build\native\imports\;
..\build\**\*.props;
}
But again I had the problem that the project I install the package on, doesn't import any of the property sheets...
(Also asked about it in StackOverflow)
I would like to be able to add an external .targets or .props file to my package and have it imported into consuming projects. It may or may not already be possible, but if it is I couldn't figure out how.