Skip to content

Commit

Permalink
solve build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vpavel04 committed Jan 8, 2024
1 parent c151752 commit 3bc7115
Show file tree
Hide file tree
Showing 36 changed files with 156 additions and 281 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ git clone https://github.com/DynamoDS/DynamoRevit.git
- Get the branch for the version of Revit you want to use. For the latest release of Revit or a preview release, master may be fine. Otherwise, run `git checkout Revit2019` or similar.
- Make sure you have the following installed on your computer:
- For Revit 2024 and older: [.Net Framework 4.8 SDK](https://dotnet.microsoft.com/download)
- For Revit 2025 (currently Preview Release) and newer: [.NET 7 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) for Windows x64
- For Revit 2025 (currently Preview Release) and newer: [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) for Windows x64
- Run `restorepackages.bat` from a command prompt with administrative privileges (Located in your _Github\DynamoRevit\src folder_)
Note: `restorepackages.bat` employs the use of a legacy tool `aget.exe`, which requires VC++ 2010 redistributable installed, before you can run it. When missing you will get an `msvcr100.dll not found` error.
- Copy `RevitAPI.dll`&`RevitAPIUI.dll` to the folder `DynamoRevit\lib\Revit Preview Release\net48`, these 2 dlls are in the folder same with `Revit.exe` installed on your computer
(if you want to build other branch of DynamoRevit, but corresponding version of Revit is not installed locally, you can get these dlls from https://www.nuget.org/ )
- Set the `RevitVersionNumber` environment variable to the Revit version you're building against (e.g. `2020`) either in the system environment or in the [user_locals.props](https://github.com/DynamoDS/DynamoRevit/blob/Revit2017/src/Config/user_local.props) file in your build folder.
- Open `DynamoRevit.All.sln` in Visual Studio, and select a build configuration (Debug | Release)
- For Revit 2025 (currently Preview Release) and newer you need Visual Studio 2022 (17.7.2 or 17.7.3, or newer)
- For Revit 2025 (currently Preview Release) and newer you need Visual Studio 2022 (17.8.0 or newer)

### 2. Get or Build Dynamo Core

Expand Down
7 changes: 7 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs

[*.{cs,csx,vb,vbx}]
indent_style = space
indent_size = 4
tab_width = 4

4 changes: 0 additions & 4 deletions src/AssemblySharedInfoGenerator/AssemblyInfoGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
<Target Name="BeforeBuildMigrated" BeforeTargets="PreBuildEvent">
<Exec Command="&quot;$(SolutionDir)restorepackages.bat&quot;" ContinueOnError="true" />
</Target>
<ItemGroup>
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<None Update="AssemblySharedInfo.tt">
<Generator>TextTemplatingFileGenerator</Generator>
Expand All @@ -35,7 +32,6 @@
<DependentUpon>AssemblySharedInfo.tt</DependentUpon>
</Compile>
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets')" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
<Target Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets')" Name="T4TemplateGen" BeforeTargets="Build">
<CallTarget Targets="TransformAll" />
Expand Down
2 changes: 2 additions & 0 deletions src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc 2017-2018")]
[assembly: AssemblyTrademark("")]

[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
Expand Down
52 changes: 0 additions & 52 deletions src/Config/CS.props

This file was deleted.

96 changes: 40 additions & 56 deletions src/Config/CS_SDK.props
Original file line number Diff line number Diff line change
@@ -1,59 +1,43 @@
<Project>
<Import Project="$(SolutionDir)Config/user_local.props" />
<PropertyGroup>
<Platforms>NET70;NET80</Platforms>
<PlatformTarget >x64</PlatformTarget>
<TargetFramework Condition="'$(Platform)' == 'NET80'">net8.0-windows</TargetFramework>
<TargetFramework Condition="'$(Platform)' == 'NET70'">net7.0-windows</TargetFramework>
<TargetFramework Condition="'$(Platform)' == 'NET60'">net6.0-windows</TargetFramework>
<TargetFramework Condition="'$(Platform)' == 'net48'">net48</TargetFramework>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">17.0</VisualStudioVersion>
<RevitVersionNumber Condition=" '$(RevitVersionNumber)' == '' ">Preview Release</RevitVersionNumber>
<REVIT_VERSION>Revit_$(RevitVersionNumber)</REVIT_VERSION>
<PACKAGESPATH>$(SolutionDir)packages</PACKAGESPATH>
<DynamoExternPath Condition=" '$(DynamoExternPath)' == '' ">$(SolutionDir)..\extern</DynamoExternPath>
<Import Project="$(SolutionDir)Config/user_local.props" />
<PropertyGroup>
<PlatformTarget >x64</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<Platforms>NET80</Platforms>
<TargetFramework>net8.0-windows</TargetFramework>
<DCoreLibSubFolder>net8.0</DCoreLibSubFolder>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">17.0</VisualStudioVersion>
<RevitVersionNumber Condition=" '$(RevitVersionNumber)' == '' ">Preview Release</RevitVersionNumber>
<REVIT_VERSION>Revit_$(RevitVersionNumber)</REVIT_VERSION>
<PACKAGESPATH>$(SolutionDir)packages</PACKAGESPATH>
<DynamoExternPath Condition=" '$(DynamoExternPath)' == '' ">$(SolutionDir)..\extern</DynamoExternPath>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">$(SolutionDir)..\lib\Revit $(RevitVersionNumber)\$(DCoreLibSubFolder)</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">C:\Program Files\Autodesk\Revit Architecture $(RevitVersionNumber)</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">C:\Program Files\Autodesk\Revit $(RevitVersionNumber)</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">C:\Program Files\Autodesk\Revit Preview Release</REVITAPI>

<Prefer32Bit>false</Prefer32Bit>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UICulture>en-US</UICulture>

<DYNAMOTESTAPI Condition=" '$(DYNAMOTESTAPI)' == '' ">C:\Program Files\Dynamo 0.7</DYNAMOTESTAPI>

<DCoreLibSubFolder Condition="'$(Platform)' == 'NET80'">net8.0</DCoreLibSubFolder>
<DCoreLibSubFolder Condition="'$(Platform)' == 'NET70'">net6.0</DCoreLibSubFolder>
<DCoreLibSubFolder Condition="'$(Platform)' == 'NET60'">net6.0</DCoreLibSubFolder>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">$(SolutionDir)..\lib\Revit $(RevitVersionNumber)\$(DCoreLibSubFolder)</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">C:\Program Files\Autodesk\Revit Architecture $(RevitVersionNumber)</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">C:\Program Files\Autodesk\Revit $(RevitVersionNumber)</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">C:\Program Files\Autodesk\Revit Preview Release</REVITAPI>

<BaseIntermediateOutputPath>$(SolutionDir)..\obj\$(Configuration)\$(Platform)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DefaultOutputPath>$(SolutionDir)..\bin\$(Configuration)\$(Platform)\$(REVIT_VERSION)</DefaultOutputPath>
<OutputPath Condition=" '$(OutputPath)' == '' ">$(DefaultOutputPath)</OutputPath>
<TestOutputPath Condition=" '$(TestOutputPath)' == '' ">$(SolutionDir)..\bin\$(Configuration)\$(Platform)\$(REVIT_VERSION)</TestOutputPath>

<NoWarn>MSB3539</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('NET'))">
<DefineConstants>$(DefineConstants);NET</DefineConstants>
<IsNETFramework>false</IsNETFramework>
</PropertyGroup>
<PropertyGroup Condition="!$(Platform.Contains('NET'))">
<IsNETFramework>true</IsNETFramework>
<DefineConstants>$(DefineConstants);NETFRAMEWORK</DefineConstants>
</PropertyGroup>
<BaseIntermediateOutputPath>$(SolutionDir)..\obj\$(Configuration)\$(Platform)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DefaultOutputPath>$(SolutionDir)..\bin\$(Configuration)\$(Platform)\$(REVIT_VERSION)</DefaultOutputPath>
<OutputPath Condition=" '$(OutputPath)' == '' ">$(DefaultOutputPath)</OutputPath>
<TestOutputPath Condition=" '$(TestOutputPath)' == '' ">$(SolutionDir)..\bin\$(Configuration)\$(Platform)\$(REVIT_VERSION)</TestOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UICulture>en-US</UICulture>
<!--MSB3539: The value of the property "BaseIntermediateOutputPath" was modified after it was used by MSBuild-->
<!--CS3001,CS3002,CS3003,CS3009,CS3016,CS3027: ...is not CLS-compliant -->
<NoWarn>MSB3539;CS3001;CS3002;CS3003;CS3009;CS3016;CS3027</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
</Project>
1 change: 0 additions & 1 deletion src/Config/packages-template.aget
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"pythonnet_py38_win": "2.5.1",
"Newtonsoft.Json": "8.0.3",
"NUnit": "3.13.3",
"Prism": "4.1.0",
"RestSharp": "106.12.0"
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Config/packages.aget
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"pythonnet_py38_win": "2.5.1",
"Newtonsoft.Json": "13.0.1",
"NUnit": "3.13.3",
"Prism": "4.1.0",
"RestSharp": "108.0.1"
}
}
Expand Down
27 changes: 11 additions & 16 deletions src/Config/user_local.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RevitVersionNumber Condition=" '$(RevitVersionNumber)' == '' ">Preview Release</RevitVersionNumber>
<REVIT_VERSION>Revit</REVIT_VERSION>
<DYNAMOTESTAPI Condition=" '$(DYNAMOTESTAPI)' == '' ">$(SolutionDir)..\bin\$(Platform)\$(Configuration)</DYNAMOTESTAPI>
<!-- local env -->
<OutputPath Condition=" '$(OutputPath)' == '' ">$(SolutionDir)..\bin\$(Platform)\$(Configuration)\$(REVIT_VERSION)</OutputPath>
<TestOutputPath Condition=" '$(TestOutputPath)' == '' ">$(OutputPath)</TestOutputPath>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('NET'))">
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">E:\RevitVersion\2025\Releasex64_NET7_20230907\Releasex64</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">D:\src\git.adsk\revit\Debugx64</REVITAPI>
</PropertyGroup>
<PropertyGroup Condition="!$(Platform.Contains('NET'))">
<!-- local env -->
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">D:\src\git.adsk\revit.release.branch\Debugx64</REVITAPI>
</PropertyGroup>
<PropertyGroup>
<RevitVersionNumber Condition=" '$(RevitVersionNumber)' == '' ">Preview Release</RevitVersionNumber>
<REVIT_VERSION>Revit</REVIT_VERSION>
<!-- local env -->
<OutputPath Condition=" '$(OutputPath)' == '' ">$(SolutionDir)..\bin\$(Platform)\$(Configuration)\$(REVIT_VERSION)</OutputPath>
<TestOutputPath Condition=" '$(TestOutputPath)' == '' ">$(OutputPath)</TestOutputPath>
</PropertyGroup>
<PropertyGroup>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">E:\RevitVersion\2025\Releasex64_NET7_20230907\Releasex64</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">D:\src\git.adsk\revit\Debugx64</REVITAPI>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions src/DynamoRevit.All.sln
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{821DE75A-8C7C-4747-B838-BA0354B15592}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoAddinGenerator", "Tools\DynamoAddinGenerator\DynamoAddinGenerator.csproj", "{92A46535-D870-4E1A-AED0-7492789E9C4A}"
ProjectSection(ProjectDependencies) = postProject
{133FC760-5699-46D9-BEA6-E816B5F01016} = {133FC760-5699-46D9-BEA6-E816B5F01016}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{9568462D-249F-4494-856B-5B25751DB361}"
ProjectSection(SolutionItems) = preProject
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoRevit/DynamoRevit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ public static string GetRevitContext(DynamoRevitCommandData commandData)
}

[DllImport("msvcrt.dll")]
public static extern int _putenv(string env);
internal static extern int _putenv(string env);

#endregion

Expand Down
32 changes: 10 additions & 22 deletions src/DynamoRevit/DynamoRevit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel>
<DebugType>full</DebugType>
<NoWarn>618</NoWarn>
<NoWarn>$(NoWarn);618</NoWarn>
<DebugSymbols>true</DebugSymbols>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
Expand Down Expand Up @@ -68,35 +68,23 @@
<HintPath>$(PACKAGESPATH)\GregRevitAuth\lib\net6.0\GregRevitAuth.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Dynamic">
<HintPath>$(PACKAGESPATH)\DynamicLanguageRuntime\lib\net45\Microsoft.Dynamic.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Practices.Prism">
<HintPath>$(PACKAGESPATH)\Prism\lib\NET40\Microsoft.Practices.Prism.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Scripting">
<HintPath>$(PACKAGESPATH)\DynamicLanguageRuntime\lib\net45\Microsoft.Scripting.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>$(PACKAGESPATH)\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>$(PACKAGESPATH)\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ProtoGeometry">
<HintPath Condition="!Exists('$(DYNAMOBUILDPATH)') ">$(PACKAGESPATH)\DynamoVisualProgramming.ZeroTouchLibrary\lib\$(DCoreLibSubFolder)\ProtoGeometry.dll</HintPath>
<HintPath Condition=" Exists('$(DYNAMOBUILDPATH)') ">$(DYNAMOBUILDPATH)\ProtoGeometry.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Python.Runtime">
<HintPath>$(PACKAGESPATH)\pythonnet\lib\net40\Python.Runtime.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RestSharp">
<HintPath>$(PACKAGESPATH)\RestSharp\lib\net6.0\RestSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Python.Runtime">
<HintPath>$(PACKAGESPATH)\pythonnet\lib\net40\Python.Runtime.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RestSharp">
<HintPath>$(PACKAGESPATH)\RestSharp\lib\net6.0\RestSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPI">
<HintPath>$(REVITAPI)\RevitAPI.dll</HintPath>
<Private>False</Private>
Expand Down
6 changes: 3 additions & 3 deletions src/DynamoRevitIcons/DynamoRevitIcons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup Condition="$(Platform.Contains('NET'))">
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
<Target Name="BeforeBuildMigrated" BeforeTargets="PreBuildEvent">
<GetReferenceAssemblyPaths TargetFrameworkMoniker=".NETFramework, Version=v4.8">
<Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="FrameworkAssembliesPath" />
Expand Down
Loading

0 comments on commit 3bc7115

Please sign in to comment.