Skip to content

Commit

Permalink
Merge pull request #101 from alvpickmans/upgrade-sdk-proj-and-r2020
Browse files Browse the repository at this point in the history
Upgrade to sdk proj and Revit2020 installer
  • Loading branch information
daren-thomas committed Jan 22, 2020
2 parents 16f7a88 + a18ac91 commit f4f2060
Show file tree
Hide file tree
Showing 40 changed files with 1,796 additions and 851 deletions.
Binary file added Output/2020.01.19_Setup_RevitPythonShell_2020.exe
Binary file not shown.
36 changes: 0 additions & 36 deletions PythonConsoleControl/Properties/AssemblyInfo.cs

This file was deleted.

15 changes: 6 additions & 9 deletions PythonConsoleControl/PythonCompletionData.cs
@@ -1,14 +1,10 @@
// Copyright (c) 2010 Joe Moorhouse

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICSharpCode.AvalonEdit.CodeCompletion;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using Microsoft.Scripting.Hosting.Shell;
using Microsoft.Scripting;
using System;

namespace PythonConsoleControl
{
Expand All @@ -17,8 +13,8 @@ namespace PythonConsoleControl
/// </summary>
public class PythonCompletionData : ICompletionData
{
CommandLine commandLine;
private CommandLine commandLine;

public PythonCompletionData(string text, string stub, CommandLine commandLine, bool isInstance)
{
this.Text = text;
Expand Down Expand Up @@ -46,7 +42,8 @@ public object Content

public object Description
{
get {
get
{
// Do nothing: description now updated externally and asynchronously.
return "Not available";
}
Expand All @@ -59,4 +56,4 @@ public void Complete(TextArea textArea, ISegment completionSegment, EventArgs in
textArea.Document.Replace(completionSegment, this.Text);
}
}
}
}
237 changes: 106 additions & 131 deletions PythonConsoleControl/PythonConsoleControl.csproj
@@ -1,124 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F1152D68-346B-4F48-8DB7-BE67B5CB1F49}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PythonConsoleControl</RootNamespace>
<AssemblyName>PythonConsoleControl</AssemblyName>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<Configurations>Debug;Debug One;Release</Configurations>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2014'">
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2015'">
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

<PropertyGroup>
<!-- Please remove the targets you don't need in order
to exclude Revit versions your add-in won't support
use the list below for matching Revit version with .NET target
2014 | net40
2015 | net45
2016 | net451
2017 | net452
2018 | net46
2019 | net47
2020 | net471
For example you can exclude Revit 2014, by simply removing net40 target belows
-->
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471</TargetFrameworks>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2016'">
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

<PropertyGroup Condition="'$(Configuration)' == 'Debug One'">
<!-- You could debug just ONE addin version,
instead of building all the versions above.
Just put ONE target from the list above
e.g. if you want to debug ONLY Revit 2019,
put net47 below and switch to 'Debug One' configuration
-->
<TargetFrameworks>net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2017'">
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
<RevitVersion>2014</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug 2018'">
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<RevitVersion>2015</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net451' ">
<RevitVersion>2016</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2015|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug 2015\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net452' ">
<RevitVersion>2017</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2016|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug 2016\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net46' ">
<RevitVersion>2018</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2017|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug 2017\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net47' ">
<RevitVersion>2019</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2018|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug 2018\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
<RevitVersion>2020</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2014|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>

<PropertyGroup>
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

<!-- Force the project to use the legacy debugger engine -->
<DebugEngines>{351668CC-8477-4fbf-BFE3-5F1006E4DB1F}</DebugEngines>

<!-- Invert the behavior of new .csproj format - exclude files by default -->
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<EnableDefaultItems>false</EnableDefaultItems>

<!-- Define handy symbols to use in the code in order to accommodate different Revit versions,
e.g. by wrapping legacy / deprecated API calls with #if REVIT2014 | REVIT2015 -->
<DefineConstants>REVIT$(RevitVersion);WINFORMS</DefineConstants>
<PreprocessorDefinitions>$(DefineConstants)</PreprocessorDefinitions>

<!-- Multiple targets can cause obj folder locking by concurrent builds -->
<BuildInParallel>false</BuildInParallel>

<!-- Override 'OutputPath' to Debug/Release + Revit version -->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>..\bin\$(Configuration)\$(RevitVersion)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 2019|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug 2019\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>

<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<OutputPath></OutputPath>
</PropertyGroup>


<ItemGroup Condition="$(DefineConstants.Contains('WINFORMS'))">
<Reference Include="System.Windows.Forms" />
</ItemGroup>

<ItemGroup>
<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.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1"/>

</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)' == 'Autodesk.Revit.SDK'" />
</ItemGroup>
</Target>

<ItemGroup>
<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.3.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
<HintPath>..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
</Reference>
<Reference Include="IronPython">
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
</Reference>
Expand All @@ -134,6 +126,10 @@
<Reference Include="Microsoft.Scripting.Metadata">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
</ItemGroup>


<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
Expand All @@ -150,7 +146,6 @@
<Compile Include="PythonCompletionData.cs" />
<Compile Include="PythonConsoleCompletionDataProvider.cs" />
<Compile Include="PythonConsole.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PythonConsoleCompletionWindow.cs" />
<Compile Include="PythonConsoleControl.xaml.cs">
<DependentUpon>PythonConsoleControl.xaml</DependentUpon>
Expand All @@ -172,35 +167,15 @@
<EmbeddedResource Include="Resources\Python.xshd" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<Folder Include="Properties\" />
</ItemGroup>

<!--
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</PropertyGroup>-->
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
6 changes: 6 additions & 0 deletions PythonConsoleControl/PythonConsoleControl.csproj.user
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion PythonConsoleControl/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AvalonEdit" version="5.0.4" targetFramework="net40" />
<package id="AvalonEdit" version="6.0.1" targetFramework="net472" />
</packages>
Binary file removed RequiredLibraries/Revit2014/RevitAPI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2014/RevitAPIUI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2015/RevitAPI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2015/RevitAPIUI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2016/RevitAPI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2016/RevitAPIUI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2017/RevitAPI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2017/RevitAPIUI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2018/RevitAPI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2018/RevitAPIUI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2019/RevitAPI.dll
Binary file not shown.
Binary file removed RequiredLibraries/Revit2019/RevitAPIUI.dll
Binary file not shown.

0 comments on commit f4f2060

Please sign in to comment.