Skip to content

Commit

Permalink
adding Revit 2020 support
Browse files Browse the repository at this point in the history
  • Loading branch information
salaros committed May 5, 2019
1 parent 960f5e6 commit 00efac2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
22 changes: 11 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ install:
# Run scripts below before
before_build:
- where msbuild
- cmd: msbuild /t:Clean
- cmd: msbuild /t:Clean

# To run your custom scripts instead of automatic MSBuild
build_script:
- cmd: msbuild /t:Rebuild
- cmd: msbuild /t:Rebuild
- ps: .\build.ps1

after_build:
- cmd: 7z a RevitAddin_2014-2019.zip %APPVEYOR_BUILD_FOLDER%\dist\*.*
- cmd: 7z a RevitAddin_2014-2019.zip %APPVEYOR_BUILD_FOLDER%\dist\**\*.*
- cmd: 7z a RevitAddin_2014-2020.zip %APPVEYOR_BUILD_FOLDER%\dist\*.*
- cmd: 7z a RevitAddin_2014-2020.zip %APPVEYOR_BUILD_FOLDER%\dist\**\*.*

artifacts:
- path: RevitAddin_2014-2019.zip
- path: RevitAddin_2014-2020.zip
name: RevitAddin

after_deploy:
Expand All @@ -83,7 +83,7 @@ after_deploy:
"Content-type" = "application/json"
}
Invoke-RestMethod -Method Put "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/settings/build-number" -Body '{"nextBuildNumber": 1 }' -Headers $headers
## Update the version in case of ragged build
$env:APPVEYOR_REPO_TAG_NAME = $env:APPVEYOR_REPO_TAG_NAME.TrimStart("v")
if ($env:APPVEYOR_REPO_TAG_NAME -match '^([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?)$') {
$tag_ver = [version]$env:APPVEYOR_REPO_TAG_NAME
Expand All @@ -94,16 +94,16 @@ after_deploy:
}
# Deploy to GitHub releases
deploy:
-
deploy:
-
provider: GitHub
auth_token:
auth_token:
secure: 2+d0KgCbWQpUR8TZfzvUEzbi4NQP6F/Tt0PUwLn6jXZCyO8FnrFVFJPsFa0QBQFl
artifact: RevitAddin
draft: false
force_update: true
prerelease: false
release: "Revit 2014-2019 C# Addin Template fro Visual Studio v$(APPVEYOR_REPO_TAG_NAME)"
release: "Revit 2014-2020 C# Addin Template fro Visual Studio v$(APPVEYOR_REPO_TAG_NAME)"
tag: $(APPVEYOR_REPO_TAG_NAME)
on:
on:
appveyor_repo_tag: true
6 changes: 6 additions & 0 deletions src/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"profiles": {
"Revit 2020": {
"commandName": "Executable",
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2020\\Revit.exe",
"commandLineArgs": "",
"use64Bit": true
},
"Revit 2019": {
"commandName": "Executable",
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2019\\Revit.exe",
Expand Down
31 changes: 16 additions & 15 deletions src/RevitAddin.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configurations>Debug;Debug One;Release</Configurations>
Expand All @@ -14,8 +14,10 @@
2017 | net452
2018 | net46
2019 | net47
2020 | net471
For example you can exclude Revit 2014, by simply removing net40 target belows
-->
<TargetFrameworks>net45;net451;net452;net46;net47</TargetFrameworks>
<TargetFrameworks>net45;net451;net452;net46;net47;net471</TargetFrameworks>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
</PropertyGroup>

Expand All @@ -26,7 +28,7 @@
e.g. if you want to debug ONLY Revit 2019,
put net47 below and switch to 'Debug One' configuration
-->
<TargetFrameworks>net47</TargetFrameworks>
<TargetFrameworks>net471</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
Expand All @@ -47,6 +49,9 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net47' ">
<RevitVersion>2019</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
<RevitVersion>2020</RevitVersion>
</PropertyGroup>

<PropertyGroup>
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
Expand Down Expand Up @@ -91,23 +96,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Revit2014x64-SDK" Version="1.1.0" Condition=" '$(RevitVersion)' == '2014' " />
<PackageReference Include="Revit.RevitApi.x64" Version="2015.0.0" Condition=" '$(RevitVersion)' == '2015' " />
<PackageReference Include="Revit.RevitApiUI.x64" Version="2015.0.0" Condition=" '$(RevitVersion)' == '2015' " />
<PackageReference Include="Revit.RevitApi.x64" Version="2016.0.0" Condition=" '$(RevitVersion)' == '2016' " />
<PackageReference Include="Revit.RevitApiUI.x64" Version="2016.0.0" Condition=" '$(RevitVersion)' == '2016' " />
<PackageReference Include="Revit.RevitApi.x64" Version="2017.0.0" Condition=" '$(RevitVersion)' == '2017' " />
<PackageReference Include="Revit.RevitApiUI.x64" Version="2017.0.0" Condition=" '$(RevitVersion)' == '2017' " />
<PackageReference Include="Revit.RevitApi.x64" Version="2018.0.0" Condition=" '$(RevitVersion)' == '2018' " />
<PackageReference Include="Revit.RevitApiUI.x64" Version="2018.0.0" Condition=" '$(RevitVersion)' == '2018' " />
<PackageReference Include="Revit.RevitApi.x64" Version="2019.0.0" Condition=" '$(RevitVersion)' == '2019' " />
<PackageReference Include="Revit.RevitApiUI.x64" Version="2019.0.0" Condition=" '$(RevitVersion)' == '2019' " />
<PackageReference Include="Autodesk.Revit.SDK" Version="2014.*" Condition=" '$(RevitVersion)' == '2014' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2015.*" Condition=" '$(RevitVersion)' == '2015' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2016.*" Condition=" '$(RevitVersion)' == '2016' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2017.*" Condition=" '$(RevitVersion)' == '2017' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.*" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
</ItemGroup>

<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
<ItemGroup>
<!-- A temporary fix for Revit SDK files being copied to the output folder -->
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Revit2014x64-SDK' Or '%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Revit.RevitApi.x64' Or '%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Revit.RevitApiUI.x64'" />
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Autodesk.Revit.SDK'" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit 00efac2

Please sign in to comment.