Skip to content
Snippets Groups Projects
Commit abb3754b authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add command line validation tool for config and status files.

Fixes #22
parent 4fd69398
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{81E0A5AC-0E0D-4F98-B399-41A58612EF33}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ATXConfigTest</RootNamespace>
<AssemblyName>AutoTxConfigTest</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AutoTxConfigTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ATXSerializables\ATXSerializables.csproj">
<Project>{166D65D5-EE10-4364-8AA3-4D86BA5CE244}</Project>
<Name>ATXSerializables</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
using System;
using System.IO;
using ATXSerializables;
namespace ATXConfigTest
{
internal class AutoTxConfigTest
{
private static ServiceConfig _config;
private static ServiceStatus _status;
private static void Main(string[] args) {
var baseDir = AppDomain.CurrentDomain.BaseDirectory;
try {
baseDir = args[0];
}
catch {
// ignored (use default value from above)
}
var configPath = Path.Combine(baseDir, "configuration.xml");
var statusPath = Path.Combine(baseDir, "status.xml");
try {
string msg;
Console.WriteLine("\nTrying to parse configuration file [{0}]...\n", configPath);
_config = ServiceConfig.Deserialize(configPath);
msg = "------------------ configuration settings ------------------";
Console.WriteLine("{0}\n{1}{0}\n", msg, _config.Summary());
Console.WriteLine("\nTrying to parse status file [{0}]...\n", statusPath);
_status = ServiceStatus.Deserialize(statusPath, _config);
msg = "------------------ status parameters ------------------";
Console.WriteLine("{0}\n{1}{0}\n", msg, _status.Summary());
}
catch (Exception ex) {
Console.WriteLine(ex);
}
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ATXConfigTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Universitaet Basel")]
[assembly: AssemblyProduct("ATXConfigTest")]
[assembly: AssemblyCopyright("Copyright © Universitaet Basel 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1efe21ab-b31e-43ef-95c3-72b9addfabb4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
......@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ATXProject", "AutoTx\ATXPro
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ATXSerializables", "ATXSerializables\ATXSerializables.csproj", "{166D65D5-EE10-4364-8AA3-4D86BA5CE244}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ATXConfigTest", "ATXConfigTest\ATXConfigTest.csproj", "{81E0A5AC-0E0D-4F98-B399-41A58612EF33}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -21,6 +23,10 @@ Global
{166D65D5-EE10-4364-8AA3-4D86BA5CE244}.Debug|Any CPU.Build.0 = Debug|Any CPU
{166D65D5-EE10-4364-8AA3-4D86BA5CE244}.Release|Any CPU.ActiveCfg = Release|Any CPU
{166D65D5-EE10-4364-8AA3-4D86BA5CE244}.Release|Any CPU.Build.0 = Release|Any CPU
{81E0A5AC-0E0D-4F98-B399-41A58612EF33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81E0A5AC-0E0D-4F98-B399-41A58612EF33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81E0A5AC-0E0D-4F98-B399-41A58612EF33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81E0A5AC-0E0D-4F98-B399-41A58612EF33}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment