Skip to content

Commit

Permalink
Draft of the E-MSBuild project (netstd2.0 + net40). Part of #55
Browse files Browse the repository at this point in the history
  • Loading branch information
3F committed Aug 25, 2019
1 parent d57b917 commit 878e1c2
Show file tree
Hide file tree
Showing 106 changed files with 3,971 additions and 3,142 deletions.
58 changes: 58 additions & 0 deletions E-MSBuild/AProperty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
* Copyright (c) E-MSBuild contributors: https://github.com/3F/E-MSBuild/graphs/contributors
*
* 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.
*/

namespace net.r_eg.EvMSBuild
{
public struct AProperty
{
/// <summary>
/// Either complex phrase or simple property.
/// For example:
/// * Property Function: $([System.DateTime]::UtcNow.Ticks)
/// * Simple property: $(Configuration)
/// </summary>
public bool complex;

/// <summary>
/// Prepared but unevaluated data, ie. the evaluation should be from this.
/// </summary>
public string unevaluated;

/// <summary>
/// The left definition of property.
/// </summary>
public string name;

/// <summary>
/// Specific project for property.
/// </summary>
public string project;

/// <summary>
/// Initial data.
/// </summary>
public string raw;
}
}
62 changes: 62 additions & 0 deletions E-MSBuild/AVariable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
* Copyright (c) E-MSBuild contributors: https://github.com/3F/E-MSBuild/graphs/contributors
*
* 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.
*/

namespace net.r_eg.EvMSBuild
{
public struct AVariable
{
/// <summary>
/// Variable name.
/// </summary>
public string name;

/// <summary>
/// Project context for variable.
/// or specific project where to store.
/// </summary>
public string project;

/// <summary>
/// Permanent storage in project files etc.
/// ~ .csproj, .vcxproj, ...
/// </summary>
public bool persistence;

/// <summary>
/// Determines value type for this variable.
/// </summary>
public ValueType type;

/// <summary>
/// $({tSign}name = data)
/// </summary>
public TSignType tSign;

/// <summary>
/// $(name {vSign}= data)
/// </summary>
public VSignType vSign;
}
}
40 changes: 40 additions & 0 deletions E-MSBuild/Analysis.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
* Copyright (c) E-MSBuild contributors: https://github.com/3F/E-MSBuild/graphs/contributors
*
* 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.
*/

namespace net.r_eg.EvMSBuild
{
public struct Analysis
{
/// <summary>
/// Prepared user-variable.
/// </summary>
public AVariable variable;

/// <summary>
/// Unit of properties.
/// </summary>
public AProperty property;
}
}
45 changes: 45 additions & 0 deletions E-MSBuild/ContainerType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
* Copyright (c) E-MSBuild contributors: https://github.com/3F/E-MSBuild/graphs/contributors
*
* 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.
*/

namespace net.r_eg.EvMSBuild
{
internal enum ContainerType
{
/// <summary>
/// $(..)
/// </summary>
Normal,

/// <summary>
/// $$(..)
/// </summary>
Escaped,

/// <summary>
/// $(..) / $$(..)
/// </summary>
Unclear,
}
}
97 changes: 97 additions & 0 deletions E-MSBuild/E-MSBuild.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>0.0.1.0</Version>
<!-- <AssemblyVersion>0.0.1.0</AssemblyVersion> -->
<!-- <FileVersion>0.0.1.0</FileVersion> -->
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net40</TargetFrameworks>
<RootNamespace>net.r_eg.EvMSBuild</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Copyright (c) 2013-2019 Denis Kuzmin &lt; x-3F@outlook.com &gt; GitHub/3F</Copyright>
<Title>[ E-MSBuild ] Advanced Evaluator of MSBuild scripts with user-variables support</Title>
<Description>
Advanced Evaluator of MSBuild scripts aka Advanced MSBuild with user-variables support through Varhead and more.

(name = " - Platform is a (Platform) ")
(name += ( …:project ))

(i += 1) / (i -= 1) / (name += "str")

(( …:( … )))

(n += 3.14)
(n += (n))

(start = ([System.DateTime]::Parse("2019/08/01").ToBinary()))
(pdir = (ProjectDir.Replace('\', '/'):project))


Read the documentation with examples.

</Description>
<PackageOwners>reg</PackageOwners>
<PackageProjectUrl>https://github.com/3F/E-MSBuild</PackageProjectUrl>
<RepositoryUrl>https://github.com/3F/E-MSBuild</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>scripts scripting variables strings expressions MSBuild evaluator parser SobaScript Varhead E-MSBuild vsSBE SBE-Scripts vsSolutionBuildEvent vsCommandEvent</PackageTags>
<PackageReleaseNotes>https://github.com/3F/E-MSBuild/blob/master/changelog.txt</PackageReleaseNotes>
<Authors>github.com/3F/E-MSBuild</Authors>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<PackageLicenseFile>License.txt</PackageLicenseFile>
<Configurations>DBG_SDK10;DBG_SDK15;REL_SDK10;REL_SDK15;DCI_SDK10;DCI_SDK15;RCI_SDK10;RCI_SDK15</Configurations>
<NoWarn>1701;1702;CS1591</NoWarn>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' Or $(Configuration.Contains('DBG_')) Or $(Configuration.Contains('DCI_')) ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' Or $(Configuration.Contains('REL_')) Or $(Configuration.Contains('RCI_')) ">
<DefineConstants />
</PropertyGroup>

<ItemGroup>
<None Include="License.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="Readme.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LSender\LSender.csproj" />
<ProjectReference Include="..\Varhead\Varhead.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<!-- <PackageReference Include="Microsoft.Build">
<Version>16.0.461</Version>
</PackageReference>
<PackageReference Include="Microsoft.Build.Framework">
<Version>16.0.461</Version>
</PackageReference> -->
<Reference Include="Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.Build.16.0.461\lib\netcoreapp2.1\Microsoft.Build.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.Build.Framework.16.0.461\lib\netstandard2.0\Microsoft.Build.Framework.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
</ItemGroup>

</Project>
46 changes: 46 additions & 0 deletions E-MSBuild/EvEnvBlank.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2019 Denis Kuzmin < x-3F@outlook.com > GitHub/3F
* Copyright (c) E-MSBuild contributors: https://github.com/3F/E-MSBuild/graphs/contributors
*
* 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.
*/

using System;
using Microsoft.Build.Evaluation;

namespace net.r_eg.EvMSBuild
{
internal sealed class EvEnvBlank: IEvEnv, IEvMin
{
private readonly IEvMin ev;
private readonly Project prj;

public string GetMutualPropValue(string name) => ev.GetMutualPropValue(name);

public Project GetProject(object ident) => prj;

public EvEnvBlank(IEvMin ev)
{
this.ev = ev ?? throw new ArgumentNullException(nameof(ev));
prj = new Project();
}
}
}
Loading

0 comments on commit 878e1c2

Please sign in to comment.