Browse Source

create a console project.

Add references/NuGets to console project.
Include basic logic to create image in console.
master
Craig Oates 6 years ago
parent
commit
7748ab33ff
  1. 6
      SmoulderingBeachBall/SmoulderingBeachBall.sln
  2. 6
      SmoulderingBeachBall/SmoulderingBeachBallCLI/App.config
  3. 41
      SmoulderingBeachBall/SmoulderingBeachBallCLI/AssemblyInfo.fs
  4. 15
      SmoulderingBeachBall/SmoulderingBeachBallCLI/Program.fs
  5. 83
      SmoulderingBeachBall/SmoulderingBeachBallCLI/SmoulderingBeachBallCLI.fsproj
  6. 6
      SmoulderingBeachBall/SmoulderingBeachBallCLI/packages.config
  7. 13
      SmoulderingBeachBall/SmoulderingBeachBallCLICore/Program.fs
  8. 20
      SmoulderingBeachBall/SmoulderingBeachBallCLICore/SmoulderingBeachBallCLICore.fsproj

6
SmoulderingBeachBall/SmoulderingBeachBall.sln

@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28010.2016
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "SmoulderingBeachBall", "SmoulderingBeachBall\SmoulderingBeachBall.fsproj", "{279C546F-588A-4343-9E11-8EB21188DA70}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "SmoulderingBeachBallCLI", "SmoulderingBeachBallCLI\SmoulderingBeachBallCLI.fsproj", "{F3027063-706C-442F-8C88-11A33E8EA222}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -15,6 +17,10 @@ Global
{279C546F-588A-4343-9E11-8EB21188DA70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{279C546F-588A-4343-9E11-8EB21188DA70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{279C546F-588A-4343-9E11-8EB21188DA70}.Release|Any CPU.Build.0 = Release|Any CPU
{F3027063-706C-442F-8C88-11A33E8EA222}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3027063-706C-442F-8C88-11A33E8EA222}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3027063-706C-442F-8C88-11A33E8EA222}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3027063-706C-442F-8C88-11A33E8EA222}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

6
SmoulderingBeachBall/SmoulderingBeachBallCLI/App.config

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
</startup>
</configuration>

41
SmoulderingBeachBall/SmoulderingBeachBallCLI/AssemblyInfo.fs

@ -0,0 +1,41 @@
namespace SmoulderingBeachBallCLI.AssemblyInfo
open System.Reflection
open System.Runtime.CompilerServices
open 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("SmoulderingBeachBallCLI")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("SmoulderingBeachBallCLI")>]
[<assembly: AssemblyCopyright("Copyright © 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("f3027063-706c-442f-8c88-11a33e8ea222")>]
// 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")>]
do
()

15
SmoulderingBeachBall/SmoulderingBeachBallCLI/Program.fs

@ -0,0 +1,15 @@
open SmoulderingBeachBall.ImageMaker
open System.Drawing
open System
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
[<EntryPoint>]
let main argv =
printfn "%A" argv
let result =
makeImage 500 500 Brushes.PaleVioletRed "C:/users/craig/desktop/test.png"
|> Async.RunSynchronously
//Console.ReadLine |> ignore
0 // return an integer exit code

83
SmoulderingBeachBall/SmoulderingBeachBallCLI/SmoulderingBeachBallCLI.fsproj

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.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>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>f3027063-706c-442f-8c88-11a33e8ea222</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SmoulderingBeachBallCLI</RootNamespace>
<AssemblyName>SmoulderingBeachBallCLI</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<UseStandardResourceNames>true</UseStandardResourceNames>
<Name>SmoulderingBeachBallCLI</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Program.fs" />
<None Include="App.config" />
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Common">
<HintPath>..\packages\System.Drawing.Common.4.5.0\lib\net461\System.Drawing.Common.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SmoulderingBeachBall\SmoulderingBeachBall.fsproj">
<Name>SmoulderingBeachBall</Name>
<Project>{279c546f-588a-4343-9e11-8eb21188da70}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!-- 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>

6
SmoulderingBeachBall/SmoulderingBeachBallCLI/packages.config

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Core" version="4.5.2" targetFramework="net471" />
<package id="System.Drawing.Common" version="4.5.0" targetFramework="net471" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net471" />
</packages>

13
SmoulderingBeachBall/SmoulderingBeachBallCLICore/Program.fs

@ -0,0 +1,13 @@
// Learn more about F# at http://fsharp.org
open System
open SmoulderingBeachBall.ImageMaker
open System.Drawing
[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
let result =
makeImage 500 500 Brushes.PaleVioletRed "C:/users/craig/desktop/test.png"
|> Async.RunSynchronously
0 // return an integer exit code

20
SmoulderingBeachBall/SmoulderingBeachBallCLICore/SmoulderingBeachBallCLICore.fsproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SmoulderingBeachBall\SmoulderingBeachBall.fsproj" />
</ItemGroup>
</Project>
Loading…
Cancel
Save