Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,11 @@ jobs:
- name: MSBuild GH Plugin
run: |
echo ${{ env.ReleaseVersion }}
msbuild src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj /p:Configuration=Release /p:Platform=x64 /p:Version=${{ env.ReleaseVersion }} /restore
mkdir installer/plugin

mv src/Ironbug.Grasshopper/bin/x64/Release/* installer/plugin
mkdir installer/HVACTemplates
cp doc/HVAC_GHTemplates/* installer/HVACTemplates -r

ls installer -r
make build-Grasshopper NEW_RELEASE_VERSION=${{ env.ReleaseVersion }}

- name: Build Ironbug.Console
run: |
dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj /p:Configuration=Release /p:Platform=x64 /p:TargetFramework=NET48 /p:Version=${{ env.ReleaseVersion }}
ls ./src/Ironbug.Console/bin/x64/Release/
7z a -tzip ironbug.console.win.zip ./src/Ironbug.Console/bin/x64/Release/

cp ./src/Ironbug.Console/bin/x64/Release/Ironbug.Console.exe installer/plugin
make build-console-win NEW_RELEASE_VERSION=${{ env.ReleaseVersion }}

- name: Unit tests
run: |
Expand Down Expand Up @@ -157,10 +146,7 @@ jobs:

- name: Build
run: |
dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj -a x64 /p:Configuration=Release /p:TargetFramework=NET8 /p:Version=${{ env.ReleaseVersion }}

ls ./src/Ironbug.Console/bin/Release/linux-x64
zip -r ironbug.console.linux.zip ./src/Ironbug.Console/bin/Release/linux-x64
make build-console-linux NEW_RELEASE_VERSION=${{ env.ReleaseVersion }}

- name: Console test
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ installer/HVACTemplates/*
bld/
[Bb]in/
[Oo]bj/
installer/plugin/
installer/HVACTemplates/

# Visual Studio 2015 cache/options directory
.vs/
Expand Down
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
NEW_RELEASE_VERSION ?= 0.0.1


build-Grasshopper:
dotnet build ./src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj /p:Configuration=Release /p:Platform=x64 /p:Version=$(NEW_RELEASE_VERSION) /restore
mkdir -p installer/plugin
mv src/Ironbug.Grasshopper/bin/x64/Release/net8-windows/* installer/plugin/
mv src/Ironbug.Grasshopper/bin/x64/Release/net48/* installer/plugin/net48/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This mv command will fail because the destination directory installer/plugin/net48/ is not created beforehand. You should create the directory before moving files into it.

	mkdir -p installer/plugin/net48
	mv src/Ironbug.Grasshopper/bin/x64/Release/net48/* installer/plugin/net48/

mkdir -p installer/HVACTemplates
cp doc/HVAC_GHTemplates/* installer/HVACTemplates -r

ls installer -r

build-console-win:
dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj /p:Configuration=Release /p:Platform=x64 /p:Version=$(NEW_RELEASE_VERSION) /restore
ls ./src/Ironbug.Console/bin/x64/Release/
7z a -tzip ironbug.console.win.zip ./src/Ironbug.Console/bin/x64/Release
rm ./src/Ironbug.Console/bin/x64/Release/net48/openstudio* -r
rm ./src/Ironbug.Console/bin/x64/Release/net8/openstudio* -r
Comment on lines +18 to +19

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While placing options after file arguments is valid for GNU rm, it's unconventional and can be less readable. For better clarity and to adhere to common practice, it's recommended to place options before the file arguments.

	rm -r ./src/Ironbug.Console/bin/x64/Release/net48/openstudio*
	rm -r ./src/Ironbug.Console/bin/x64/Release/net8/openstudio*


cp ./src/Ironbug.Console/bin/x64/Release/net8/* installer/plugin
cp ./src/Ironbug.Console/bin/x64/Release/net48/* installer/plugin/net48/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The cp command on this line has an implicit dependency on the build-Grasshopper target to create the installer/plugin/net48/ directory. This makes the build process fragile. For instance, running this target alone would fail. To make this target more robust and self-contained, create the directory before copying files into it.

	mkdir -p installer/plugin/net48
	cp ./src/Ironbug.Console/bin/x64/Release/net48/* installer/plugin/net48/


7z a -tzip installer/plugin/net48.zip ./installer/plugin/net48/*
rm -r installer/plugin/net48

build-console-linux:
dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj -a x64 /p:Configuration=Release /p:TargetFramework=net8 /p:Version=$(NEW_RELEASE_VERSION)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This dotnet build command is inconsistent with the other build commands in this file. For better maintainability and predictability, it's good to keep them consistent.

Specifically:

  • It uses -a x64 while others use /p:Platform=x64.
  • It's missing the /restore flag, which is explicitly used in other commands. While dotnet build performs an implicit restore, being explicit improves clarity and consistency.
	dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj /p:Platform=x64 /p:Configuration=Release /p:TargetFramework=net8 /p:Version=$(NEW_RELEASE_VERSION) /restore

ls ./src/Ironbug.Console/bin/Release/linux-x64/net8
zip -r ironbug.console.linux.zip ./src/Ironbug.Console/bin/Release/linux-x64/net8

4 changes: 2 additions & 2 deletions src/Ironbug.Console/Ironbug.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>NET48;NET8</TargetFrameworks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<TargetFrameworks>net48;net8</TargetFrameworks>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<Platforms>x64</Platforms>
<Version>9.99.0</Version>
</PropertyGroup>
Expand Down
13 changes: 11 additions & 2 deletions src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>NET48</TargetFramework>
<TargetFrameworks>net48;net8-windows</TargetFrameworks>
<Platforms>x64</Platforms>
<TargetExt>.gha</TargetExt>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<Version>1.0.1</Version>
<UseWindowsForms>true</UseWindowsForms>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>

</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand All @@ -18,6 +21,12 @@
<PackageReference Include="NREL.OpenStudio.win" Version="3.9.0.1" IncludeAssets="compile;build" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<!-- References specific to .NET Framework 4.8 -->
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\Ironbug.Core\Ironbug.Core.csproj" />
<ProjectReference Include="..\Ironbug.HVAC\Ironbug.HVAC.csproj" />
Expand Down
Loading