Skip to content

Commit f4f2060

Browse files
authored
Merge pull request #101 from alvpickmans/upgrade-sdk-proj-and-r2020
Upgrade to sdk proj and Revit2020 installer
2 parents 16f7a88 + a18ac91 commit f4f2060

40 files changed

+1796
-851
lines changed
Binary file not shown.

PythonConsoleControl/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

PythonConsoleControl/PythonCompletionData.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
// Copyright (c) 2010 Joe Moorhouse
22

3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
73
using ICSharpCode.AvalonEdit.CodeCompletion;
84
using ICSharpCode.AvalonEdit.Document;
95
using ICSharpCode.AvalonEdit.Editing;
106
using Microsoft.Scripting.Hosting.Shell;
11-
using Microsoft.Scripting;
7+
using System;
128

139
namespace PythonConsoleControl
1410
{
@@ -17,8 +13,8 @@ namespace PythonConsoleControl
1713
/// </summary>
1814
public class PythonCompletionData : ICompletionData
1915
{
20-
CommandLine commandLine;
21-
16+
private CommandLine commandLine;
17+
2218
public PythonCompletionData(string text, string stub, CommandLine commandLine, bool isInstance)
2319
{
2420
this.Text = text;
@@ -46,7 +42,8 @@ public object Content
4642

4743
public object Description
4844
{
49-
get {
45+
get
46+
{
5047
// Do nothing: description now updated externally and asynchronously.
5148
return "Not available";
5249
}
@@ -59,4 +56,4 @@ public void Complete(TextArea textArea, ISegment completionSegment, EventArgs in
5956
textArea.Document.Replace(completionSegment, this.Text);
6057
}
6158
}
62-
}
59+
}

PythonConsoleControl/PythonConsoleControl.csproj

Lines changed: 106 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,116 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{F1152D68-346B-4F48-8DB7-BE67B5CB1F49}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>PythonConsoleControl</RootNamespace>
12-
<AssemblyName>PythonConsoleControl</AssemblyName>
13-
<FileAlignment>512</FileAlignment>
14-
<PublishUrl>publish\</PublishUrl>
15-
<Install>true</Install>
16-
<InstallFrom>Disk</InstallFrom>
17-
<UpdateEnabled>false</UpdateEnabled>
18-
<UpdateMode>Foreground</UpdateMode>
19-
<UpdateInterval>7</UpdateInterval>
20-
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
21-
<UpdatePeriodically>false</UpdatePeriodically>
22-
<UpdateRequired>false</UpdateRequired>
23-
<MapFileExtensions>true</MapFileExtensions>
24-
<ApplicationRevision>0</ApplicationRevision>
25-
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
26-
<IsWebBootstrapper>false</IsWebBootstrapper>
27-
<UseApplicationTrust>false</UseApplicationTrust>
28-
<BootstrapperEnabled>true</BootstrapperEnabled>
29-
<TargetFrameworkProfile />
30-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
4+
<Configurations>Debug;Debug One;Release</Configurations>
315
</PropertyGroup>
32-
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2014'">
33-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
34-
</PropertyGroup>
35-
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2015'">
36-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
6+
7+
<PropertyGroup>
8+
<!-- Please remove the targets you don't need in order
9+
to exclude Revit versions your add-in won't support
10+
use the list below for matching Revit version with .NET target
11+
2014 | net40
12+
2015 | net45
13+
2016 | net451
14+
2017 | net452
15+
2018 | net46
16+
2019 | net47
17+
2020 | net471
18+
For example you can exclude Revit 2014, by simply removing net40 target belows
19+
-->
20+
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471</TargetFrameworks>
21+
<RuntimeIdentifiers>win</RuntimeIdentifiers>
22+
<PublishSingleFile>true</PublishSingleFile>
3723
</PropertyGroup>
38-
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2016'">
39-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
24+
25+
<PropertyGroup Condition="'$(Configuration)' == 'Debug One'">
26+
<!-- You could debug just ONE addin version,
27+
instead of building all the versions above.
28+
Just put ONE target from the list above
29+
e.g. if you want to debug ONLY Revit 2019,
30+
put net47 below and switch to 'Debug One' configuration
31+
-->
32+
<TargetFrameworks>net40</TargetFrameworks>
4033
</PropertyGroup>
41-
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2017'">
42-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
34+
35+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
36+
<RevitVersion>2014</RevitVersion>
4337
</PropertyGroup>
44-
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2018'">
45-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
38+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
39+
<RevitVersion>2015</RevitVersion>
4640
</PropertyGroup>
47-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
48-
<DebugSymbols>true</DebugSymbols>
49-
<DebugType>full</DebugType>
50-
<Optimize>false</Optimize>
51-
<OutputPath>..\..\bin\</OutputPath>
52-
<DefineConstants>DEBUG;TRACE</DefineConstants>
53-
<ErrorReport>prompt</ErrorReport>
54-
<WarningLevel>4</WarningLevel>
55-
<Prefer32Bit>false</Prefer32Bit>
41+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net451' ">
42+
<RevitVersion>2016</RevitVersion>
5643
</PropertyGroup>
57-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
58-
<DebugType>pdbonly</DebugType>
59-
<Optimize>true</Optimize>
60-
<OutputPath>bin\Release\</OutputPath>
61-
<DefineConstants>TRACE</DefineConstants>
62-
<ErrorReport>prompt</ErrorReport>
63-
<WarningLevel>4</WarningLevel>
64-
<Prefer32Bit>false</Prefer32Bit>
65-
</PropertyGroup>
66-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2015|AnyCPU'">
67-
<DebugSymbols>true</DebugSymbols>
68-
<OutputPath>bin\Debug 2015\</OutputPath>
69-
<DefineConstants>DEBUG;TRACE</DefineConstants>
70-
<DebugType>full</DebugType>
71-
<PlatformTarget>AnyCPU</PlatformTarget>
72-
<ErrorReport>prompt</ErrorReport>
73-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
74-
<Prefer32Bit>false</Prefer32Bit>
44+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net452' ">
45+
<RevitVersion>2017</RevitVersion>
7546
</PropertyGroup>
76-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2016|AnyCPU'">
77-
<DebugSymbols>true</DebugSymbols>
78-
<OutputPath>bin\Debug 2016\</OutputPath>
79-
<DefineConstants>DEBUG;TRACE</DefineConstants>
80-
<DebugType>full</DebugType>
81-
<PlatformTarget>AnyCPU</PlatformTarget>
82-
<ErrorReport>prompt</ErrorReport>
83-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
84-
<Prefer32Bit>false</Prefer32Bit>
47+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net46' ">
48+
<RevitVersion>2018</RevitVersion>
8549
</PropertyGroup>
86-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2017|AnyCPU'">
87-
<DebugSymbols>true</DebugSymbols>
88-
<OutputPath>bin\Debug 2017\</OutputPath>
89-
<DefineConstants>DEBUG;TRACE</DefineConstants>
90-
<DebugType>full</DebugType>
91-
<PlatformTarget>AnyCPU</PlatformTarget>
92-
<ErrorReport>prompt</ErrorReport>
93-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
94-
<Prefer32Bit>false</Prefer32Bit>
50+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net47' ">
51+
<RevitVersion>2019</RevitVersion>
9552
</PropertyGroup>
96-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2018|AnyCPU'">
97-
<DebugSymbols>true</DebugSymbols>
98-
<OutputPath>bin\Debug 2018\</OutputPath>
99-
<DefineConstants>DEBUG;TRACE</DefineConstants>
100-
<DebugType>full</DebugType>
101-
<PlatformTarget>AnyCPU</PlatformTarget>
102-
<ErrorReport>prompt</ErrorReport>
103-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
104-
<Prefer32Bit>false</Prefer32Bit>
53+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
54+
<RevitVersion>2020</RevitVersion>
10555
</PropertyGroup>
106-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2014|AnyCPU'">
107-
<Prefer32Bit>false</Prefer32Bit>
56+
57+
<PropertyGroup>
58+
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
59+
<PlatformTarget>x64</PlatformTarget>
60+
<Platforms>x64</Platforms>
61+
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
62+
63+
<!-- Force the project to use the legacy debugger engine -->
64+
<DebugEngines>{351668CC-8477-4fbf-BFE3-5F1006E4DB1F}</DebugEngines>
65+
66+
<!-- Invert the behavior of new .csproj format - exclude files by default -->
67+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
68+
<EnableDefaultItems>false</EnableDefaultItems>
69+
70+
<!-- Define handy symbols to use in the code in order to accommodate different Revit versions,
71+
e.g. by wrapping legacy / deprecated API calls with #if REVIT2014 | REVIT2015 -->
72+
<DefineConstants>REVIT$(RevitVersion);WINFORMS</DefineConstants>
73+
<PreprocessorDefinitions>$(DefineConstants)</PreprocessorDefinitions>
74+
75+
<!-- Multiple targets can cause obj folder locking by concurrent builds -->
76+
<BuildInParallel>false</BuildInParallel>
77+
78+
<!-- Override 'OutputPath' to Debug/Release + Revit version -->
79+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
80+
<OutputPath>..\bin\$(Configuration)\$(RevitVersion)</OutputPath>
10881
</PropertyGroup>
109-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2019|AnyCPU'">
110-
<DebugSymbols>true</DebugSymbols>
111-
<OutputPath>bin\Debug 2019\</OutputPath>
112-
<DefineConstants>DEBUG;TRACE</DefineConstants>
82+
83+
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
84+
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
11385
<DebugType>full</DebugType>
114-
<PlatformTarget>AnyCPU</PlatformTarget>
115-
<ErrorReport>prompt</ErrorReport>
116-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
86+
<OutputPath></OutputPath>
11787
</PropertyGroup>
88+
89+
90+
<ItemGroup Condition="$(DefineConstants.Contains('WINFORMS'))">
91+
<Reference Include="System.Windows.Forms" />
92+
</ItemGroup>
93+
94+
<ItemGroup>
95+
<PackageReference Include="Autodesk.Revit.SDK" Version="2014.*" Condition=" '$(RevitVersion)' == '2014' " PrivateAssets="All" />
96+
<PackageReference Include="Autodesk.Revit.SDK" Version="2015.*" Condition=" '$(RevitVersion)' == '2015' " PrivateAssets="All" />
97+
<PackageReference Include="Autodesk.Revit.SDK" Version="2016.*" Condition=" '$(RevitVersion)' == '2016' " PrivateAssets="All" />
98+
<PackageReference Include="Autodesk.Revit.SDK" Version="2017.*" Condition=" '$(RevitVersion)' == '2017' " PrivateAssets="All" />
99+
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
100+
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
101+
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
102+
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
103+
104+
</ItemGroup>
105+
106+
<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
107+
<ItemGroup>
108+
<!-- A temporary fix for Revit SDK files being copied to the output folder -->
109+
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Autodesk.Revit.SDK'" />
110+
</ItemGroup>
111+
</Target>
112+
118113
<ItemGroup>
119-
<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.3.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
120-
<HintPath>..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
121-
</Reference>
122114
<Reference Include="IronPython">
123115
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
124116
</Reference>
@@ -134,6 +126,10 @@
134126
<Reference Include="Microsoft.Scripting.Metadata">
135127
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
136128
</Reference>
129+
</ItemGroup>
130+
131+
132+
<ItemGroup>
137133
<Reference Include="PresentationCore" />
138134
<Reference Include="PresentationFramework" />
139135
<Reference Include="System" />
@@ -150,7 +146,6 @@
150146
<Compile Include="PythonCompletionData.cs" />
151147
<Compile Include="PythonConsoleCompletionDataProvider.cs" />
152148
<Compile Include="PythonConsole.cs" />
153-
<Compile Include="Properties\AssemblyInfo.cs" />
154149
<Compile Include="PythonConsoleCompletionWindow.cs" />
155150
<Compile Include="PythonConsoleControl.xaml.cs">
156151
<DependentUpon>PythonConsoleControl.xaml</DependentUpon>
@@ -172,35 +167,15 @@
172167
<EmbeddedResource Include="Resources\Python.xshd" />
173168
</ItemGroup>
174169
<ItemGroup>
175-
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
176-
<Visible>False</Visible>
177-
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
178-
<Install>true</Install>
179-
</BootstrapperPackage>
180-
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
181-
<Visible>False</Visible>
182-
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
183-
<Install>false</Install>
184-
</BootstrapperPackage>
185-
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
186-
<Visible>False</Visible>
187-
<ProductName>.NET Framework 3.5 SP1</ProductName>
188-
<Install>false</Install>
189-
</BootstrapperPackage>
190-
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
191-
<Visible>False</Visible>
192-
<ProductName>Windows Installer 3.1</ProductName>
193-
<Install>true</Install>
194-
</BootstrapperPackage>
195-
</ItemGroup>
196-
<ItemGroup>
197-
<None Include="packages.config" />
170+
<Folder Include="Properties\" />
198171
</ItemGroup>
172+
173+
<!--
199174
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
200175
<PropertyGroup>
201176
<PostBuildEvent>
202177
</PostBuildEvent>
203-
</PropertyGroup>
178+
</PropertyGroup>-->
204179
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
205180
Other similar extension points exist, see Microsoft.Common.targets.
206181
<Target Name="BeforeBuild">
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ShowAllFiles>false</ShowAllFiles>
5+
</PropertyGroup>
6+
</Project>

PythonConsoleControl/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="AvalonEdit" version="5.0.4" targetFramework="net40" />
3+
<package id="AvalonEdit" version="6.0.1" targetFramework="net472" />
44
</packages>
-38.4 MB
Binary file not shown.
-1.73 MB
Binary file not shown.
-39.3 MB
Binary file not shown.
-2.04 MB
Binary file not shown.
-25.3 MB
Binary file not shown.
-2.41 MB
Binary file not shown.
-25 MB
Binary file not shown.
-2.57 MB
Binary file not shown.
-25.7 MB
Binary file not shown.
-2.61 MB
Binary file not shown.
-26.5 MB
Binary file not shown.
-2.68 MB
Binary file not shown.

0 commit comments

Comments
 (0)