jeremytammik / RevitLookup

Interactive Revit RFA and RVT project database exploration tool to view and navigate BIM element parameters, properties and relationships.
http://thebuildingcoder.typepad.com
MIT License
1.03k stars 294 forks source link

Cleanup. Build system #101

Closed Nice3point closed 2 years ago

Nice3point commented 2 years ago

Corrected the style of the code in accordance with the latest guidelines

Nice3point commented 2 years ago

Now you can track changes for each commit

Nice3point commented 2 years ago

In recent commits, I have integrated the build system from my template https://github.com/Nice3point/RevitTemplates. Now the installer will build directly to github. After installation, I launched Revit, everything seems to work. For debugging added copying to AppData\Roaming\Autodesk\Revit\Addins\2022. To local build, net core 5 is required. If you still have version 3, please update

Nice3point commented 2 years ago

You can check how git action works here https://github.com/Nice3point/RevitLookup/actions/runs/1392275582 Artifacts will have an installer

Nice3point commented 2 years ago

That's all for now. Enjoy testing

jeremytammik commented 2 years ago

You say, 'To local build, net core 5 is required. If you still have version 3, please update'...

Don't you think this might be a problem for many? I have not installed .NET Core 5 myself...

jeremytammik commented 2 years ago

I am researching how to update to net core 5 and am not clear yet on what exactly needs to be done to achieve that...

jeremytammik commented 2 years ago

Oh, maybe I have it already?

C:\Users\jta>dotnet --version
5.0.202
jeremytammik commented 2 years ago

I cloned and built with zero errors and warnings.

jeremytammik commented 2 years ago

I see that the Revit API assemblies are now copied to the local folders:

/Users/jta/a/src/rvt/RevitLookup % find . | grep dll
./RevitLookup/obj/Debug/RevitLookup.dll
./RevitLookup/bin/AddIn 2022 Debug/RevitLookup/RevitLookup.dll
./RevitLookup/bin/Debug/AdWindows.dll
./RevitLookup/bin/Debug/RevitLookup.dll
./RevitLookup/bin/Debug/RevitAddInUtility.dll
./RevitLookup/bin/Debug/RevitAPIUI.dll
./RevitLookup/bin/Debug/RevitAPI.dll
./RevitLookup/bin/Debug/UIFramework.dll

Since they are not directly referenced, I cannot set local copy to false.

Is this normal and expected?

jeremytammik commented 2 years ago

I see that the installer is named Revit Lookup.aip with an embedded space. For consistency, can we remove that space? Can I remove it myself, or will that break any dependencies?

jeremytammik commented 2 years ago

Looking great! It installed by itself on compilation and is now up and running fine, afaict.

jeremytammik commented 2 years ago

integrated into release 2022.0.1.1: https://github.com/jeremytammik/RevitLookup/releases/tag/2022.0.1.1

peterhirn commented 2 years ago

Gitlab CI is currently broken because the shared-windows-runners don't have .net5 pre-installed. Since everything is build in Github actions now, I think we should remove Gitlab completely.

Are the build artifacts attached to releases? https://lookupbuilds.com could be a simple 301 to https://github.com/jeremytammik/RevitLookup/releases

Nice3point commented 2 years ago

Oh, maybe I have it already?

C:\Users\jta>dotnet --version
5.0.202

yes you already have the required version. in any case, you can download it here https://dotnet.microsoft.com/download or directly through Visual Studio

Nice3point commented 2 years ago

I see that the Revit API assemblies are now copied to the local folders: Since they are not directly referenced, I cannot set local copy to false.

Is this normal and expected?

I have included the Nuget package and it is ok, this solves the build problem on the server

Nice3point commented 2 years ago

I see that the installer is named Revit Lookup.aip with an embedded space. For consistency, can we remove that space? Can I remove it myself, or will that break any dependencies?

I don't know what this file is. It was in your repository, so I didn't delete it

Nice3point commented 2 years ago

Gitlab CI is currently broken because the shared-windows-runners don't have .net5 pre-installed.

https://github.com/jeremytammik/RevitLookup/blob/master/.gitlab-ci.yml#L44 The path to the .sln file may be incorrect. Try changing it to "RevitLookup.sln"

Nice3point commented 2 years ago

and remove this line https://github.com/jeremytammik/RevitLookup/blob/master/.gitlab-ci.yml#L60. I think the .pdb file is not required at all

Nice3point commented 2 years ago

to build installer on local machine install this via terminal dotnet tool install Nuke.GlobalTool --global Then you can run nuke command. Watch the video https://github.com/Nice3point/RevitTemplates/wiki/Installer-creation

Nice3point commented 2 years ago

Don't forget to change the installer version before releases https://github.com/jeremytammik/RevitLookup/blob/master/installer/Installer.cs#L19 As well as the GUID https://github.com/jeremytammik/RevitLookup/blob/master/installer/Installer.cs#L37 after the release of the new version of Revit. Since the project only has support for a single version. It is necessary to change the GUID so that the version is not updated, but a new one is installed

peterhirn commented 2 years ago

I'm not fixing things while arguing for its removal.

Is it possible to have the pipeline output attached as release asset?

Nice3point commented 2 years ago

I'm not fixing things while arguing for its removal.

Is it possible to have the pipeline output attached as release asset?

https://github.com/marketplace/actions/automatic-releases I think yes, it can be done

jeremytammik commented 2 years ago

You say, Don't forget to change the installer version before releases...

I see a constant version number defined as

        private const string Version = "22.0.1";

So far, I only maintained the version number in AssemblyInfo.cs, currently set to 2022.0.1.1.

It would help if these two numbers were the same, wouldn't it?

jeremytammik commented 2 years ago

Regarding the GUID after the release of the new version of Revit... does the GUID in the RevitLookup installer have to match the Revit product GUID?

Nice3point commented 2 years ago

Throws an exception, the version number must be less than 256. This number is displayed in windows Settings> Apps> Apps & features http://dl3.joxi.net/drive/2021/10/28/0037/1994/2467786/86/1206056905.png

Nice3point commented 2 years ago

Regarding the GUID after the release of the new version of Revit... does the GUID in the RevitLookup installer have to match the Revit product GUID?

No, the installer guid is only needed for Windows for updating, installing programs. It will only be in the installer.cs file

Nice3point commented 2 years ago

you can leave your 2022 version name for releases, just remove the first number 20 in the installer so that Windows does not give an error

jeremytammik commented 2 years ago

No, the installer guid is only needed for Windows. It will only be in the installer.cs file

Aha. So the installer GUID can be arbitrary?

the version number must be less than 256

Wow. Can it have four items, major.minor.maintenance.build? I thought that was the official Windows standard.

Nice3point commented 2 years ago

Wow. Can it have four items, major.minor.maintenance.build? I thought that was the official Windows standard.

Yes, you can set the revision number http://dl3.joxi.net/drive/2021/10/28/0037/1994/2467786/86/8acc97bf0d.png private const string Version = "22.0.1.0"; like this. But I noticed the minor version never updates for you and is always 0, can you reduce the version number?

Nice3point commented 2 years ago

No, the installer guid is only needed for Windows. It will only be in the installer.cs file

Aha. So the installer GUID can be arbitrary?

Yes, absolutely any GUID, but it should only be updated after upgrading to a new version of Revit. So that for one version the installer is updated and not duplicated in the Windows control panel

Nice3point commented 2 years ago

Revit versions are also double digit. Limiting to 256 number is a Windows rule http://dl3.joxi.net/drive/2021/10/28/0037/1994/2467786/86/f094c13c3b.png

Nice3point commented 2 years ago

If you do add the revision number, add this line to the installer.cs file MajorUpgrade.Default.AllowSameVersionUpgrades = true; http://joxi.ru/l2ZdDoVHRX360r.png otherwise the installers will be duplicated in the control panel http://dl3.joxi.net/drive/2021/10/28/0037/1994/2467786/86/c19039638f.png

Nice3point commented 2 years ago

https://github.com/jeremytammik/RevitLookup/blob/master/RevitLookup/AssemblyInfo.cs#L188 By the way, updating the DLL version number is not at all necessary, I deleted this file from my projects altogether. We now have an installer, all information about the application can be added to it. https://github.com/jeremytammik/RevitLookup/blob/master/installer/Installer.cs#L40 in this section you can fill in the information to be displayed in the control panel

jeremytammik commented 2 years ago

Oh, I see another space in

https://github.com/jeremytammik/RevitLookup/blob/master/installer/Installer.cs#L16

:-)

I found AssemblyInfo.cs a handy place to maintain the history.

Nice3point commented 2 years ago

Oh, I see another space in

You see this name during installation and in the control panel)

jeremytammik commented 2 years ago

I would remove that space and stick with RevitLookup as one word globally.

Nice3point commented 2 years ago

OK, no problem

jeremytammik commented 2 years ago

So, maybe I should move the history to the installer. However, the AssemblyInfo data is also embedded in the DLL itself. So, surely it is a good thing to have the precise version number there as well?

Nice3point commented 2 years ago

I think we can output the changelog directly to the installer, wixSharp supports the creation of additional dialog boxes. Or better yet, create a separate .md file on github for this. And AssemblyInfo can be removed so as not to duplicate information

jeremytammik commented 2 years ago

Yes, that sounds like the best solution to me.

jeremytammik commented 2 years ago

Would the version number still also be embedded in the DLL itself?

Nice3point commented 2 years ago

Would the version number still also be embedded in the DLL itself?

изображение The dll version number can be specified in the project .csproj file

jeremytammik commented 2 years ago

So then you suggest removing AssemblyInfo, moving the history to the installer, and adding the DLL file version to the csproj? Sounds good to me!

Nice3point commented 2 years ago

So then you suggest removing AssemblyInfo, moving the history to the installer, and adding the DLL file version to the csproj? Sounds good to me!

yes, I already created a new pull request =)

jeremytammik commented 2 years ago

thank you!