/// <summary> /// Returns the package name based on the <paramref name="template"/>'s Output Target and folder location within the designer. /// </summary> /// <param name="template"></param> /// <param name="rootFolder"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public static string GetPackageName <T>(this KotlinTemplateBase <T> template, string rootFolder) { { if (template.Model is IHasFolder model) { return(string.Join(".", new[] { template.OutputTarget.GetPackageName(rootFolder) }.Concat(model.GetParentFolderNames())).ToKotlinPackage()); } } { if (template.Model is IHasFolder <IFolder> model) { return(string.Join(".", new [] { template.OutputTarget.GetPackageName(rootFolder) }.Concat(model.GetParentFolderNames())).ToKotlinPackage()); } } return(template.OutputTarget.GetPackageName(rootFolder)); }
/// <summary> /// Returns the package name based on the <paramref name="template"/>'s Output Target and folder location within the designer. /// Uses the 'kotlin' folder as the root for the package name. /// </summary> /// <param name="template"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public static string GetPackageName <T>(this KotlinTemplateBase <T> template) { return(GetPackageName(template, "kotlin")); }