Skip to content

Commit

Permalink
Merge pull request #9 from Etive-Mor/add-nuget-details
Browse files Browse the repository at this point in the history
Adds nuget
  • Loading branch information
liamlaverty authored Mar 29, 2024
2 parents 7ceb662 + 911270e commit a5de7bf
Show file tree
Hide file tree
Showing 18 changed files with 114 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,6 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml


nuget.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace EtiveMor.OpenImoCiiCalculator.Console
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>OpenImoCiiCalculator.Core</Title>
<Authors>LiamLaverty</Authors>
<Company>Etive Mor</Company>
<Description>Contains the core assemblies needed to calculate an IMO Carbon Intensity Index value for ships</Description>
<PackageProjectUrl>https://github.com/Etive-Mor/Open-IMO-CII-Calculator</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>shipping; sustainability; ship carbon emissions; marine; cii; international trade; imo; carbon intensity; imo cii; shipping cii; carbon intensity indicator; shipping carbon intensity indicator; international maritime organization;</PackageTags>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>$(VersionPrefix)</Version>
<RepositoryUrl>https://github.com/Etive-Mor/Open-IMO-CII-Calculator</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>EtiveMor.OpenImoCiiCalculator.Core.Tests</_Parameter1>
</AssemblyAttribute>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace EtiveMor.OpenImoCiiCalculator.Core.Models.ShipModels
{


public class Ship
internal class Ship
{
public Ship(
ShipType shipType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EtiveMor.OpenImoCiiCalculator.Core.Services
{
public interface ICarbonIntensityIndicatorCalculatorService
internal interface ICarbonIntensityIndicatorCalculatorService
{
double GetAttainedCarbonIntensity(double massOfCo2Emissions, double transportWork);
double GetRequiredCarbonIntensity(ShipType shipType, double capacity, int year);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace EtiveMor.OpenImoCiiCalculator.Core.Services
{
public interface IRatingBoundariesService
internal interface IRatingBoundariesService
{
ShipDdVectorBoundaries GetBoundaries(Ship ship, double requiredCiiInYear, int year);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace EtiveMor.OpenImoCiiCalculator.Core.Services
{
public interface IShipCapacityCalculatorService
internal interface IShipCapacityCalculatorService
{
double GetShipCapacity(Ship ship);
double GetShipCapacity(ShipType shipType, double deadweightTonnage, double grossTonnage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EtiveMor.OpenImoCiiCalculator.Core.Services
{
public interface IShipMassOfCo2EmissionsCalculatorService
internal interface IShipMassOfCo2EmissionsCalculatorService
{
double GetFuelCarbonContent(TypeOfFuel fuelType);
double GetFuelLowerCalorificValue(TypeOfFuel fuelType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace EtiveMor.OpenImoCiiCalculator.Core.Services
{
public interface IShipTransportWorkCalculatorService
internal interface IShipTransportWorkCalculatorService
{
double GetShipTransportWork(double capacity, double distanceSailed);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace EtiveMor.OpenImoCiiCalculator.Core.Services.Impl
{
public class CarbonIntensityIndicatorCalculatorService : ICarbonIntensityIndicatorCalculatorService
internal class CarbonIntensityIndicatorCalculatorService : ICarbonIntensityIndicatorCalculatorService
{
/// <summary>
/// Gets a ship's attained carbon intensity, which is the ratio of the cumulative mass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EtiveMor.OpenImoCiiCalculator.Core.Services.Impl
{
public class RatingBoundariesService : IRatingBoundariesService
internal class RatingBoundariesService : IRatingBoundariesService
{
/// <summary>
/// Returns the ship grading boundaries ouelines in MEPC354(78) for a given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace EtiveMor.OpenImoCiiCalculator.Core.Services.Impl
{


public class ShipCapacityCalculatorService : IShipCapacityCalculatorService
internal class ShipCapacityCalculatorService : IShipCapacityCalculatorService
{
/// <summary>
/// Calculates the ship's capacity according to the MEPC.353(78)guidelines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EtiveMor.OpenImoCiiCalculator.Core.Services.Impl
{
public class ShipMassOfCo2EmissionsCalculatorService : IShipMassOfCo2EmissionsCalculatorService
internal class ShipMassOfCo2EmissionsCalculatorService : IShipMassOfCo2EmissionsCalculatorService
{
/// <summary>
/// Gets the mass of CO2 emissions in grams (g) for a given fuel type and fuel consumption mass.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace EtiveMor.OpenImoCiiCalculator.Core.Services.Impl
{
public class ShipTransportWorkCalculatorService : IShipTransportWorkCalculatorService
internal class ShipTransportWorkCalculatorService : IShipTransportWorkCalculatorService
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\EtiveMor.OpenImoCiiCalculator.Core\EtiveMor.OpenImoCiiCalculator.Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using EtiveMor.OpenImoCiiCalculator.Core;
using EtiveMor.OpenImoCiiCalculator.Core.Models.Enums;
using EtiveMor.OpenImoCiiCalculator.Core.Services.Impl;
using Newtonsoft.Json;

namespace EtiveMor.OpenImoCiiCalculator.DemoConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Generating a ship result now...");

var calculator = new Calculator();

var result = calculator.CalculateAttainedCiiRating(
ShipType.RoRoPassengerShip,
grossTonnage: 25000,
deadweightTonnage: 0,
distanceTravelled: 150000,
TypeOfFuel.DIESEL_OR_GASOIL,
fuelConsumption: 1.9e+10,
2019);


string json = JsonConvert.SerializeObject(result, Formatting.Indented);
Console.WriteLine(json);
Console.WriteLine("Press any key to finish");
Console.ReadKey();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ VisualStudioVersion = 17.7.34302.85
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EtiveMor.OpenImoCiiCalculator.Core", "EtiveMor.OpenImoCiiCalculator.Core\EtiveMor.OpenImoCiiCalculator.Core.csproj", "{72A10AB0-F070-44EF-ABA0-EABF72D18169}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EtiveMor.OpenImoCiiCalculator.Core.Tests", "EtiveMor.OpenImoCiiCalculator.Core.Tests\EtiveMor.OpenImoCiiCalculator.Core.Tests.csproj", "{1FFA056E-2C89-443E-84BA-2613E7E9B08E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EtiveMor.OpenImoCiiCalculator.Core.Tests", "EtiveMor.OpenImoCiiCalculator.Core.Tests\EtiveMor.OpenImoCiiCalculator.Core.Tests.csproj", "{1FFA056E-2C89-443E-84BA-2613E7E9B08E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EtiveMor.OpenImoCiiCalculator.DemoConsoleApp", "EtiveMor.OpenImoCiiCalculator.DemoConsoleApp\EtiveMor.OpenImoCiiCalculator.DemoConsoleApp.csproj", "{0BA83418-F2F8-4FCB-BAB7-CBA195EBDDA2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -21,6 +23,10 @@ Global
{1FFA056E-2C89-443E-84BA-2613E7E9B08E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FFA056E-2C89-443E-84BA-2613E7E9B08E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FFA056E-2C89-443E-84BA-2613E7E9B08E}.Release|Any CPU.Build.0 = Release|Any CPU
{0BA83418-F2F8-4FCB-BAB7-CBA195EBDDA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BA83418-F2F8-4FCB-BAB7-CBA195EBDDA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BA83418-F2F8-4FCB-BAB7-CBA195EBDDA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0BA83418-F2F8-4FCB-BAB7-CBA195EBDDA2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit a5de7bf

Please sign in to comment.