This commit is contained in:
2025-05-13 01:22:44 +03:00
parent 245b02f962
commit 03602b8138
27 changed files with 2078 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
/bin
/obj
+11
View File
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions {
public class Action {
}
}
+14
View File
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Actions</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SharpCompress" Version="0.39.0" />
</ItemGroup>
</Project>
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.IO.Compression;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Formats.Tar;
using SharpCompress.Compressors.BZip2;
using SharpCompress.Archives;
using SharpCompress.Common;
namespace Actions {
public static class Archive {
public static void UnpackTarGz(string archiveFileName, string outDirectory) {
using var fileStream = File.OpenRead(archiveFileName);
using var gzipStream = new GZipStream(fileStream, CompressionMode.Decompress);
TarFile.ExtractToDirectory(gzipStream, outDirectory, true);
}
public static void UnpackTarBz2(string archiveFileName, string outDirectory) {
using var fileStream = File.OpenRead(archiveFileName);
using var bz2Stream = new BZip2Stream(fileStream, SharpCompress.Compressors.CompressionMode.Decompress, false);
TarFile.ExtractToDirectory(bz2Stream, outDirectory, true);
}
public static void UnpackZip(string archiveFileName, string outDirectory) {
using var fileStream = File.OpenRead(archiveFileName);
using var zipArchive = SharpCompress.Archives.Zip.ZipArchive.Open(fileStream);
foreach (var entry in zipArchive.Entries.Where(entry => !entry.IsDirectory)) {
entry.WriteToDirectory(outDirectory, new ExtractionOptions() {
ExtractFullPath = true,
Overwrite = true
});
}
}
}
}
+18
View File
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions.Library {
public class CMake {
public static void Configure(string sourceDirectoryPath, string buildDirectoryPath) {
SystemProcess.Run("cmake", $"-DCMAKE_BUILD_TYPE:STRING=\"Release\" -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE:PATH=\"{buildDirectoryPath}/bin\" -H{sourceDirectoryPath} -B{buildDirectoryPath}", null);
}
public static void Build(string buildDirectoryPath) {
SystemProcess.Run("cmake", $"--build {buildDirectoryPath} --config Release", null);
}
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Actions.Library {
public static class Config {
private static string PropertyNamePrefix = "Actions_";
private static string? Get([CallerMemberName]string? name = null) {
if(string.IsNullOrWhiteSpace(name)) {
throw new ArgumentNullException(nameof(name));
}
var result = System.Environment.GetEnvironmentVariable(PropertyNamePrefix + name);
return result;
}
private static void Set(string? value, [CallerMemberName] string? name = null) {
if (string.IsNullOrWhiteSpace(name)) {
throw new ArgumentNullException(nameof(name));
}
System.Environment.SetEnvironmentVariable(PropertyNamePrefix + name, value);
}
public static string? Nuget_RepoAuth { get { return Get(); } set { Set(value); } }
public static string? Nuget_RepoName { get { return Get(); } set { Set(value); } }
public static string? ArtifactsOutputDirectory { get { var result = Get(); return string.IsNullOrWhiteSpace(result) ? ".artifacts" : result; } set { Set(value); } }
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions {
public enum CpuArchitecture {
x86,
x64,
armeabi_v7a,
arm64_v8a,
riscv32
}
}
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Actions.Library.SystemProcess;
namespace Actions {
public static class Download {
public static async Task<byte[]?> BytesFromUrl(string url) {
using (var client = new HttpClient())
using (var result = await client.GetAsync(url))
return result.IsSuccessStatusCode ? await result.Content.ReadAsByteArrayAsync() : null;
}
public static async Task<string?> FileFromUrl(string url, string outputFilePath) {
using var client = new HttpClient();
using var result = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead);
if(!result.IsSuccessStatusCode) {
return null;
}
using var responseStream = result.Content.ReadAsStream();
using var destinationFileStream = new FileStream(outputFilePath, FileMode.CreateNew);
responseStream.CopyTo(destinationFileStream);
return outputFilePath;
}
}
}
+25
View File
@@ -0,0 +1,25 @@
using Actions.Library;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions {
public class Executable {
public string FullPath {
get; private set;
}
private Executable() { FullPath = "UNKNOWN"; }
public Executable(string fullPath) {
if (!File.Exists(fullPath)) {
throw new FileNotFoundException($"Executable file not found at path {fullPath}");
}
FullPath = fullPath;
}
public SystemProcess.Result Run(string args, string? workingDirectory = null) {
return SystemProcess.Run(FullPath, args, workingDirectory);
}
}
}
+44
View File
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions {
public static class Find {
public static string? SystemFilePath(string name) {
name = Environment.ExpandEnvironmentVariables(name);
if (!File.Exists(name)) {
if (string.IsNullOrEmpty(Path.GetDirectoryName(name))) {
foreach (string test in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(';')) {
string path = test.Trim();
if (!String.IsNullOrEmpty(path) && File.Exists(path = Path.Combine(path, name)))
return Path.GetFullPath(path);
}
}
return null;
}
return Path.GetFullPath(name);
}
public static string? ExecutablePath(string name) {
string? result = SystemFilePath(name);
if (result == null) {
if (!name.ToLower().EndsWith(".exe")) {
name = name + ".exe";
result = SystemFilePath(name);
}
}
return result;
}
public static Executable? Executable(string name) {
var path = ExecutablePath(name);
if (path == null) {
return null;
}
return new Executable(path);
}
}
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Sergey Serb
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+31
View File
@@ -0,0 +1,31 @@
using Actions.Library;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions.Nuget {
public class Nuget {
public static void DeletePackage(string repository, string packageName, string packageVersion) {
var result = SystemProcess.Run("dotnet", $"nuget delete {packageName} {packageVersion} -s {repository} --non-interactive");
if (!result.Succeeded) {
throw new Exception("Failed to delete nuget package");
}
}
public static void PushPackage(string repository, string packageFilePath, string? workingDirectory = null) {
var result = SystemProcess.Run("dotnet", $"nuget push --source {repository} {packageFilePath}", workingDirectory);
if (!result.Succeeded) {
throw new Exception("Failed to push nuget package");
}
}
public static void PackPackage(string workingDirectory) {
var result = SystemProcess.Run("nuget", "pack", workingDirectory);
if (!result.Succeeded) {
throw new Exception($"Failed to pack nuget package: {string.Join("\n", result.StdError)}");
}
}
}
}
+58
View File
@@ -0,0 +1,58 @@
using Actions.Nuget.Nuspec;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace Actions.Nuget {
public class NuspecFile {
public Nuspec.Package package;
public NuspecFile() {
package = new Nuspec.Package();
}
public NuspecFile(string id, string version, string authors, string owners, Uri projectUrl, bool requireLicenseAcceptance, string description, string[] tags, string license) {
package = new Nuspec.Package();
package.Metadata = new Nuspec.PackageMetadata();
package.Metadata.Authors = authors;
package.Metadata.Owners = owners;
package.Metadata.Id = id;
package.Metadata.Version = version;
package.Metadata.ProjectUrl = projectUrl.ToString();
package.Metadata.RequireLicenseAcceptance = requireLicenseAcceptance;
package.Metadata.Description = description;
package.Metadata.Tags = string.Join(" ", tags);
package.Metadata.License = new PackageMetadataLicense();
package.Metadata.License.Value = license;
package.Metadata.License.Type = "expression";
}
public void Serialize(Stream outStream) {
XmlSerializer serializer = new XmlSerializer(typeof(Nuspec.Package), "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd");
serializer.Serialize(outStream, package);
}
public void SerializeToFile(string path) {
var outFileStream = System.IO.File.Open(path, FileMode.Create, FileAccess.Write);
Serialize(outFileStream);
outFileStream.Close();
}
public void Deserialize(Stream inStream) {
XmlSerializer serializer = new XmlSerializer(typeof(Nuspec.Package), "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd");
package = (Nuspec.Package)serializer.Deserialize(inStream);
}
public void DeserializeFromFile(string path) {
var inFileStream = System.IO.File.Open(path, FileMode.Open, FileAccess.Read);
Deserialize(inFileStream);
inFileStream.Close();
}
}
}
+962
View File
@@ -0,0 +1,962 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// This code was generated by XmlSchemaClassGenerator version 2.1.1142.0 using the following command:
// XmlSchemaClassGenerator.Console -n http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd=Actions.Nuget.Nuspec --nullable E:\nuspec.xsd
namespace Actions.Nuget.Nuspec {
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("dependency", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class Dependency {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("id")]
public string Id { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("version")]
public string Version { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("include")]
public string Include { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("exclude")]
public string Exclude { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("dependencyGroup", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class DependencyGroup {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<Dependency> _dependency;
[System.Xml.Serialization.XmlElementAttribute("dependency")]
public System.Collections.ObjectModel.Collection<Dependency> Dependency {
get {
return _dependency;
}
private set {
_dependency = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Dependency collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool DependencySpecified {
get {
return (this.Dependency.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="DependencyGroup" /> class.</para>
/// </summary>
public DependencyGroup() {
this._dependency = new System.Collections.ObjectModel.Collection<Dependency>();
}
[System.Xml.Serialization.XmlAttributeAttribute("targetFramework")]
public string TargetFramework { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("reference", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class Reference {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("file")]
public string File { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("contentFileEntries", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class ContentFileEntries {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("include")]
public string Include { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("exclude")]
public string Exclude { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("buildAction")]
public string BuildAction { get; set; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Xml.Serialization.XmlAttributeAttribute("copyToOutput")]
public bool CopyToOutputValue { get; set; }
/// <summary>
/// <para xml:lang="en">Gets or sets a value indicating whether the CopyToOutput property is specified.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public bool CopyToOutputValueSpecified { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
public System.Nullable<bool> CopyToOutput {
get {
if (this.CopyToOutputValueSpecified) {
return this.CopyToOutputValue;
} else {
return null;
}
}
set {
this.CopyToOutputValue = value.GetValueOrDefault();
this.CopyToOutputValueSpecified = value.HasValue;
}
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Xml.Serialization.XmlAttributeAttribute("flatten")]
public bool FlattenValue { get; set; }
/// <summary>
/// <para xml:lang="en">Gets or sets a value indicating whether the Flatten property is specified.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public bool FlattenValueSpecified { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
public System.Nullable<bool> Flatten {
get {
if (this.FlattenValueSpecified) {
return this.FlattenValue;
} else {
return null;
}
}
set {
this.FlattenValue = value.GetValueOrDefault();
this.FlattenValueSpecified = value.HasValue;
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("referenceGroup", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class ReferenceGroup {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<Reference> _reference;
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlElementAttribute("reference")]
public System.Collections.ObjectModel.Collection<Reference> Reference {
get {
return _reference;
}
private set {
_reference = value;
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="ReferenceGroup" /> class.</para>
/// </summary>
public ReferenceGroup() {
this._reference = new System.Collections.ObjectModel.Collection<Reference>();
}
[System.Xml.Serialization.XmlAttributeAttribute("targetFramework")]
public string TargetFramework { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("frameworkReference", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class FrameworkReference {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("name")]
public string Name { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("frameworkReferenceGroup", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class FrameworkReferenceGroup {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<FrameworkReference> _frameworkReference;
[System.Xml.Serialization.XmlElementAttribute("frameworkReference")]
public System.Collections.ObjectModel.Collection<FrameworkReference> FrameworkReference {
get {
return _frameworkReference;
}
private set {
_frameworkReference = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the FrameworkReference collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FrameworkReferenceSpecified {
get {
return (this.FrameworkReference.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="FrameworkReferenceGroup" /> class.</para>
/// </summary>
public FrameworkReferenceGroup() {
this._frameworkReference = new System.Collections.ObjectModel.Collection<FrameworkReference>();
}
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("targetFramework")]
public string TargetFramework { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("package", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute("package", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
public partial class Package {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlElementAttribute("metadata")]
public PackageMetadata Metadata { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<PackageFilesFile> _files;
[System.Xml.Serialization.XmlArrayAttribute("files", IsNullable = true)]
[System.Xml.Serialization.XmlArrayItemAttribute("file", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
public System.Collections.ObjectModel.Collection<PackageFilesFile> Files {
get {
return _files;
}
private set {
_files = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Files collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FilesSpecified {
get {
return (this.Files.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="Package" /> class.</para>
/// </summary>
public Package() {
this._files = new System.Collections.ObjectModel.Collection<PackageFilesFile>();
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadata", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadata {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlElementAttribute("id")]
public string Id { get; set; }
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlElementAttribute("version")]
public string Version { get; set; }
[System.Xml.Serialization.XmlElementAttribute("title")]
public string Title { get; set; }
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlElementAttribute("authors")]
public string Authors { get; set; }
[System.Xml.Serialization.XmlElementAttribute("owners")]
public string Owners { get; set; }
[System.Xml.Serialization.XmlElementAttribute("licenseUrl")]
public string LicenseUrl { get; set; }
[System.Xml.Serialization.XmlElementAttribute("projectUrl")]
public string ProjectUrl { get; set; }
[System.Xml.Serialization.XmlElementAttribute("iconUrl")]
public string IconUrl { get; set; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Xml.Serialization.XmlElementAttribute("requireLicenseAcceptance")]
public bool RequireLicenseAcceptanceValue { get; set; }
/// <summary>
/// <para xml:lang="en">Gets or sets a value indicating whether the RequireLicenseAcceptance property is specified.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public bool RequireLicenseAcceptanceValueSpecified { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
public System.Nullable<bool> RequireLicenseAcceptance {
get {
if (this.RequireLicenseAcceptanceValueSpecified) {
return this.RequireLicenseAcceptanceValue;
} else {
return null;
}
}
set {
this.RequireLicenseAcceptanceValue = value.GetValueOrDefault();
this.RequireLicenseAcceptanceValueSpecified = value.HasValue;
}
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Xml.Serialization.XmlElementAttribute("developmentDependency")]
public bool DevelopmentDependencyValue { get; set; }
/// <summary>
/// <para xml:lang="en">Gets or sets a value indicating whether the DevelopmentDependency property is specified.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public bool DevelopmentDependencyValueSpecified { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
public System.Nullable<bool> DevelopmentDependency {
get {
if (this.DevelopmentDependencyValueSpecified) {
return this.DevelopmentDependencyValue;
} else {
return null;
}
}
set {
this.DevelopmentDependencyValue = value.GetValueOrDefault();
this.DevelopmentDependencyValueSpecified = value.HasValue;
}
}
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlElementAttribute("description")]
public string Description { get; set; }
[System.Xml.Serialization.XmlElementAttribute("summary")]
public string Summary { get; set; }
[System.Xml.Serialization.XmlElementAttribute("releaseNotes")]
public string ReleaseNotes { get; set; }
[System.Xml.Serialization.XmlElementAttribute("copyright")]
public string Copyright { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
private string _language = "en-US";
[System.ComponentModel.DefaultValueAttribute("en-US")]
[System.Xml.Serialization.XmlElementAttribute("language")]
public string Language {
get {
return _language;
}
set {
_language = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("tags")]
public string Tags { get; set; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Xml.Serialization.XmlElementAttribute("serviceable")]
public bool ServiceableValue { get; set; }
/// <summary>
/// <para xml:lang="en">Gets or sets a value indicating whether the Serviceable property is specified.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public bool ServiceableValueSpecified { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
public System.Nullable<bool> Serviceable {
get {
if (this.ServiceableValueSpecified) {
return this.ServiceableValue;
} else {
return null;
}
}
set {
this.ServiceableValue = value.GetValueOrDefault();
this.ServiceableValueSpecified = value.HasValue;
}
}
[System.Xml.Serialization.XmlElementAttribute("icon")]
public string Icon { get; set; }
[System.Xml.Serialization.XmlElementAttribute("readme")]
public string Readme { get; set; }
[System.Xml.Serialization.XmlElementAttribute("repository")]
public PackageMetadataRepository Repository { get; set; }
[System.Xml.Serialization.XmlElementAttribute("license")]
public PackageMetadataLicense License { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<PackageMetadataPackageTypesPackageType> _packageTypes;
[System.Xml.Serialization.XmlArrayAttribute("packageTypes")]
[System.Xml.Serialization.XmlArrayItemAttribute("packageType", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
public System.Collections.ObjectModel.Collection<PackageMetadataPackageTypesPackageType> PackageTypes {
get {
return _packageTypes;
}
private set {
_packageTypes = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the PackageTypes collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool PackageTypesSpecified {
get {
return (this.PackageTypes.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageMetadata" /> class.</para>
/// </summary>
public PackageMetadata() {
this._packageTypes = new System.Collections.ObjectModel.Collection<PackageMetadataPackageTypesPackageType>();
this._frameworkAssemblies = new System.Collections.ObjectModel.Collection<PackageMetadataFrameworkAssembliesFrameworkAssembly>();
this._frameworkReferences = new System.Collections.ObjectModel.Collection<FrameworkReferenceGroup>();
this._contentFiles = new System.Collections.ObjectModel.Collection<ContentFileEntries>();
}
[System.Xml.Serialization.XmlElementAttribute("dependencies")]
public PackageMetadataDependencies Dependencies { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<PackageMetadataFrameworkAssembliesFrameworkAssembly> _frameworkAssemblies;
[System.Xml.Serialization.XmlArrayAttribute("frameworkAssemblies")]
[System.Xml.Serialization.XmlArrayItemAttribute("frameworkAssembly", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
public System.Collections.ObjectModel.Collection<PackageMetadataFrameworkAssembliesFrameworkAssembly> FrameworkAssemblies {
get {
return _frameworkAssemblies;
}
private set {
_frameworkAssemblies = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the FrameworkAssemblies collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FrameworkAssembliesSpecified {
get {
return (this.FrameworkAssemblies.Count != 0);
}
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<FrameworkReferenceGroup> _frameworkReferences;
[System.Xml.Serialization.XmlArrayAttribute("frameworkReferences")]
[System.Xml.Serialization.XmlArrayItemAttribute("group", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
public System.Collections.ObjectModel.Collection<FrameworkReferenceGroup> FrameworkReferences {
get {
return _frameworkReferences;
}
private set {
_frameworkReferences = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the FrameworkReferences collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FrameworkReferencesSpecified {
get {
return (this.FrameworkReferences.Count != 0);
}
}
[System.Xml.Serialization.XmlElementAttribute("references")]
public PackageMetadataReferences References { get; set; }
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<ContentFileEntries> _contentFiles;
[System.Xml.Serialization.XmlArrayAttribute("contentFiles")]
[System.Xml.Serialization.XmlArrayItemAttribute("files", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
public System.Collections.ObjectModel.Collection<ContentFileEntries> ContentFiles {
get {
return _contentFiles;
}
private set {
_contentFiles = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the ContentFiles collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool ContentFilesSpecified {
get {
return (this.ContentFiles.Count != 0);
}
}
[System.Xml.Serialization.XmlAttributeAttribute("minClientVersion")]
public string MinClientVersion { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataRepository", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataRepository {
[System.Xml.Serialization.XmlAttributeAttribute("type")]
public string Type { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("url")]
public string Url { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("branch")]
public string Branch { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("commit")]
public string Commit { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataLicense", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataLicense {
/// <summary>
/// <para xml:lang="en">Gets or sets the text value.</para>
/// </summary>
[System.Xml.Serialization.XmlTextAttribute()]
public string Value { get; set; }
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("type")]
public string Type { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("version")]
public string Version { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataPackageTypes", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataPackageTypes {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<PackageMetadataPackageTypesPackageType> _packageType;
[System.Xml.Serialization.XmlElementAttribute("packageType")]
public System.Collections.ObjectModel.Collection<PackageMetadataPackageTypesPackageType> PackageType {
get {
return _packageType;
}
private set {
_packageType = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the PackageType collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool PackageTypeSpecified {
get {
return (this.PackageType.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageMetadataPackageTypes" /> class.</para>
/// </summary>
public PackageMetadataPackageTypes() {
this._packageType = new System.Collections.ObjectModel.Collection<PackageMetadataPackageTypesPackageType>();
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataPackageTypesPackageType", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataPackageTypesPackageType {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("name")]
public string Name { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("version")]
public string Version { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataDependencies", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataDependencies {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<Dependency> _dependency;
[System.Xml.Serialization.XmlElementAttribute("dependency")]
public System.Collections.ObjectModel.Collection<Dependency> Dependency {
get {
return _dependency;
}
private set {
_dependency = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Dependency collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool DependencySpecified {
get {
return (this.Dependency.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageMetadataDependencies" /> class.</para>
/// </summary>
public PackageMetadataDependencies() {
this._dependency = new System.Collections.ObjectModel.Collection<Dependency>();
this._group = new System.Collections.ObjectModel.Collection<DependencyGroup>();
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<DependencyGroup> _group;
[System.Xml.Serialization.XmlElementAttribute("group")]
public System.Collections.ObjectModel.Collection<DependencyGroup> Group {
get {
return _group;
}
private set {
_group = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Group collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool GroupSpecified {
get {
return (this.Group.Count != 0);
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataFrameworkAssemblies", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataFrameworkAssemblies {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<PackageMetadataFrameworkAssembliesFrameworkAssembly> _frameworkAssembly;
[System.Xml.Serialization.XmlElementAttribute("frameworkAssembly")]
public System.Collections.ObjectModel.Collection<PackageMetadataFrameworkAssembliesFrameworkAssembly> FrameworkAssembly {
get {
return _frameworkAssembly;
}
private set {
_frameworkAssembly = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the FrameworkAssembly collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FrameworkAssemblySpecified {
get {
return (this.FrameworkAssembly.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageMetadataFrameworkAssemblies" /> class.</para>
/// </summary>
public PackageMetadataFrameworkAssemblies() {
this._frameworkAssembly = new System.Collections.ObjectModel.Collection<PackageMetadataFrameworkAssembliesFrameworkAssembly>();
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataFrameworkAssembliesFrameworkAssembly", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataFrameworkAssembliesFrameworkAssembly {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("assemblyName")]
public string AssemblyName { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("targetFramework")]
public string TargetFramework { get; set; }
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataFrameworkReferences", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataFrameworkReferences {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<FrameworkReferenceGroup> _group;
[System.Xml.Serialization.XmlElementAttribute("group")]
public System.Collections.ObjectModel.Collection<FrameworkReferenceGroup> Group {
get {
return _group;
}
private set {
_group = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Group collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool GroupSpecified {
get {
return (this.Group.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageMetadataFrameworkReferences" /> class.</para>
/// </summary>
public PackageMetadataFrameworkReferences() {
this._group = new System.Collections.ObjectModel.Collection<FrameworkReferenceGroup>();
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataReferences", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataReferences {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<Reference> _reference;
[System.Xml.Serialization.XmlElementAttribute("reference")]
public System.Collections.ObjectModel.Collection<Reference> Reference {
get {
return _reference;
}
private set {
_reference = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Reference collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool ReferenceSpecified {
get {
return (this.Reference.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageMetadataReferences" /> class.</para>
/// </summary>
public PackageMetadataReferences() {
this._reference = new System.Collections.ObjectModel.Collection<Reference>();
this._group = new System.Collections.ObjectModel.Collection<ReferenceGroup>();
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<ReferenceGroup> _group;
[System.Xml.Serialization.XmlElementAttribute("group")]
public System.Collections.ObjectModel.Collection<ReferenceGroup> Group {
get {
return _group;
}
private set {
_group = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Group collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool GroupSpecified {
get {
return (this.Group.Count != 0);
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageMetadataContentFiles", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageMetadataContentFiles {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<ContentFileEntries> _files;
[System.Xml.Serialization.XmlElementAttribute("files")]
public System.Collections.ObjectModel.Collection<ContentFileEntries> Files {
get {
return _files;
}
private set {
_files = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the Files collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FilesSpecified {
get {
return (this.Files.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageMetadataContentFiles" /> class.</para>
/// </summary>
public PackageMetadataContentFiles() {
this._files = new System.Collections.ObjectModel.Collection<ContentFileEntries>();
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageFiles", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageFiles {
[System.Xml.Serialization.XmlIgnoreAttribute()]
private System.Collections.ObjectModel.Collection<PackageFilesFile> _file;
[System.Xml.Serialization.XmlElementAttribute("file")]
public System.Collections.ObjectModel.Collection<PackageFilesFile> File {
get {
return _file;
}
private set {
_file = value;
}
}
/// <summary>
/// <para xml:lang="en">Gets a value indicating whether the File collection is empty.</para>
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FileSpecified {
get {
return (this.File.Count != 0);
}
}
/// <summary>
/// <para xml:lang="en">Initializes a new instance of the <see cref="PackageFiles" /> class.</para>
/// </summary>
public PackageFiles() {
this._file = new System.Collections.ObjectModel.Collection<PackageFilesFile>();
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("XmlSchemaClassGenerator", "2.1.1142.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute("PackageFilesFile", Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", AnonymousType = true)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PackageFilesFile {
[System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings = true)]
[System.Xml.Serialization.XmlAttributeAttribute("src")]
public string Src { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("target")]
public string Target { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute("exclude")]
public string Exclude { get; set; }
}
}
+1
View File
@@ -0,0 +1 @@
# Actions.Library
+10
View File
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions {
public class RunCmake : Action {
}
}
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Actions.Library {
public class SystemProcess {
public class Result {
public List<string> StdError = new List<string>();
public List<string> StdOut = new List<string>();
public int ExitCode;
public bool Succeeded {
get { return ExitCode == 0; }
}
}
public static Result Run(string executablePath, string arguments, string? workingDirectory = null) {
Result result = new Result();
Process process = new Process();
process.OutputDataReceived += (object sender, DataReceivedEventArgs e) => {
if(e.Data != null) {
result.StdOut.Add(e.Data);
Console.WriteLine(e.Data);
}
};
process.ErrorDataReceived += (object sender, DataReceivedEventArgs e) => {
if (e.Data != null) {
result.StdError.Add(e.Data);
Console.WriteLine(e.Data);
}
};
process.StartInfo.FileName = executablePath;
process.StartInfo.Arguments = arguments;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
if (!string.IsNullOrWhiteSpace(workingDirectory)) {
process.StartInfo.WorkingDirectory = workingDirectory;
}
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.WaitForExit();
result.ExitCode = process.ExitCode;
return result;
}
}
}
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Actions.Library {
public static class TempDirectory {
public static string New() {
var assemblyPath = Assembly.GetEntryAssembly().Location;
var assemblyDir = Path.GetDirectoryName(assemblyPath);
var tmpDir = Path.Combine(assemblyDir, "Temp");
Directory.CreateDirectory(tmpDir);
int id = 0;
while (true) {
var dir = Path.Combine(tmpDir, id.ToString());
if (!Directory.Exists(dir)) {
Directory.CreateDirectory(dir);
return dir;
}
++id;
}
}
}
}
+117
View File
@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using Actions.Library;
namespace Actions {
public static class VisualStudio {
public static class Version {
public static readonly string VisualStudio2017 = "14.16";
public static readonly string VisualStudio2015 = "14.0";
}
public class VSWhereOutput {
public List<Instance> Instances = new List<Instance>();
public class Instance {
public System.Text.Json.JsonElement JsonElement;
public string DisplayName => JsonElement.GetProperty("displayName").GetString();
public bool IsLaunchable => JsonElement.GetProperty("isLaunchable").GetBoolean();
public bool IsPrerelease => JsonElement.GetProperty("isPrerelease").GetBoolean();
public string Catalog_ProductLineVersion => JsonElement.GetProperty("catalog").GetProperty("productLineVersion").GetString();
public string Catalog_ProductSemanticVersion => JsonElement.GetProperty("catalog").GetProperty("productSemanticVersion").GetString();
//
}
public VSWhereOutput(System.Text.Json.JsonDocument vswhereJsonOutput) {
var cnt = vswhereJsonOutput.RootElement.GetArrayLength();
for (int i = 0; i < cnt; i++) {
Instance inst = new Instance();
inst.JsonElement = vswhereJsonOutput.RootElement[i];
Instances.Add(inst);
}
}
}
public static VSWhereOutput VSWhereQuery(bool latest, bool prerelease) {
var programFilesDir = System.Environment.GetEnvironmentVariable("ProgramFiles(x86)");
var vsInstalledDir = Path.Combine(programFilesDir, @"Microsoft Visual Studio\Installer\");
var vsWherePath = Path.Combine(vsInstalledDir, "vswhere.exe");
var vsWhereResult = SystemProcess.Run(vsWherePath, $"-format json -nologo {(latest ? "-latest" : "")} {(prerelease ? "-prerelease" : "")}");
var json = System.Text.Json.JsonDocument.Parse(string.Join("\n", vsWhereResult.StdOut));
VSWhereOutput result = new VSWhereOutput(json);
return result;
}
public static string FindVisualStudioPath() {
var programFilesDir = System.Environment.GetEnvironmentVariable("ProgramFiles(x86)");
var vsInstalledDir = Path.Combine(programFilesDir, @"Microsoft Visual Studio\Installer\");
var vsWherePath = Path.Combine(vsInstalledDir, "vswhere.exe");
var vsWhereResult = SystemProcess.Run(vsWherePath, "-latest -property installationPath");
Console.WriteLine("Detected VisualStudio installation path: " + vsWhereResult.StdOut[0]);
return vsWhereResult.StdOut[0];
}
public static string FindVCvarsallBatFile() {
var vsInstallPath = FindVisualStudioPath();
return Path.Combine(vsInstallPath, @"VC\Auxiliary\Build\vcvarsall.bat");
}
public static void SetupEnvironment(CpuArchitecture targetArch) {
var programFilesDir = System.Environment.GetEnvironmentVariable("ProgramFiles(x86)");
var vsInstalledDir = Path.Combine(programFilesDir, @"Microsoft Visual Studio\Installer\");
var vsWherePath = Path.Combine(vsInstalledDir, "vswhere.exe");
var vsWhereResult = SystemProcess.Run(vsWherePath, "-latest -property installationPath");
var vsInstallPath = vsWhereResult.StdOut[0];
Console.WriteLine("Setting up build environment");
var vsEnvBatchFile = FindVCvarsallBatFile();
var batchFileArgs = "";
if (targetArch == CpuArchitecture.x86) {
batchFileArgs = "x86";
} else if (targetArch == CpuArchitecture.x64) {
batchFileArgs = "amd64";
} else if (targetArch == CpuArchitecture.armeabi_v7a) {
batchFileArgs = "x86_arm";
} else if (targetArch == CpuArchitecture.arm64_v8a) {
batchFileArgs = "x86_arm64";
}
//batchFileArgs += $" -vcvars_ver={Config.VisualStudio.ToolsetVersion}";
var vsEnvResult = SystemProcess.Run("cmd", $"/C \"{vsEnvBatchFile}\" {batchFileArgs} > nul 2>&1 && set");
Regex r = new Regex("^([^=]+)=(.*)");
foreach (var s in vsEnvResult.StdOut) {
var m = r.Match(s);
if (m.Success) {
System.Environment.SetEnvironmentVariable(m.Groups[1].Value, m.Groups[2].Value);
}
}
}
public static void CleanEnvironment() {
var batchFileArgs = " /clean_env";
var vsEnvBatchFile = FindVCvarsallBatFile();
var vsEnvResult = SystemProcess.Run("cmd", $"/C \"{vsEnvBatchFile}\" {batchFileArgs} > nul 2>&1 && set");
Regex r = new Regex("^([^=]+)=(.*)");
foreach (var s in vsEnvResult.StdOut) {
var m = r.Match(s);
if (m.Success) {
System.Environment.SetEnvironmentVariable(m.Groups[1].Value, m.Groups[2].Value);
}
}
}
}
}