/// <summary> /// Returns a namespace string based on the full path from the <paramref name="target"/>. This will include folders and C# projects. /// </summary> /// <param name="target"></param> /// <returns></returns> public static string GetNamespace(this IOutputTarget target) { return(string.Join(".", target.GetTargetPath() .Where(x => !x.Metadata.ContainsKey("Namespace Provider") || x.Metadata["Namespace Provider"] as bool? == true) .Select(x => x.Name.ToCSharpNamespace()))); }
/// <summary> /// Returns the package name of the <paramref name="target"/>'s using the <paramref name="rootFolder"/> folder as the root. /// </summary> /// <param name="target"></param> /// <param name="rootFolder"></param> /// <returns></returns> public static string GetPackageName(this IOutputTarget target, string rootFolder) { return(string.Join(".", target.GetTargetPath().Select(x => x.Name) .Reverse() .TakeWhile(x => !string.Equals(x, rootFolder, StringComparison.InvariantCultureIgnoreCase)) .Reverse()) .ToKotlinPackage()); }
public static ICSharpProject GetProject(this IOutputTarget outputTarget) { return(new CSharpProject(outputTarget.GetTargetPath()[0])); }
public IList <IOutputTarget> GetTargetPath() { return(_outputTarget.GetTargetPath()); }
public static string GetPackage(this IOutputTarget target) { return(string.Join(".", target.GetTargetPath().Select(x => x.Name)).Split(new [] { "java." }, StringSplitOptions.RemoveEmptyEntries).Last().ToJavaPackage()); }