Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Mar 27, 2024
1 parent 063293f commit 6366d7b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.0] / YYYY-MM-DD
- First Release
## [1.0.0] / 2024-03-27
### Features
- `RevitVersion` to `DefineConstants`
- `REVIT####_OR_GREATER` and `REVIT####_OR_LESS`

[vNext]: ../../compare/1.0.0...HEAD
[1.0.0]: ../../compare/1.0.0
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Build](../../actions/workflows/Build.yml/badge.svg)](../../actions)

Convert `RevitVersion` property to `DefineConstants` with version 2017 to 2025.

## Installation

```xml
<PackageReference Include="RevitVersion.DefineConstants" Version="*-*" />
```

## Example
### RevitVersion 2024

```xml
<PropertyGroup>
<RevitVersion>2024</RevitVersion>
</PropertyGroup>
```

Generate `DefineConstants`:
```xml
<PropertyGroup>
<DefineConstants>$(DefineConstants);REVIT2024</DefineConstants>
<DefineConstants>$(DefineConstants);REVIT2024_OR_GREATER;REVIT2023_OR_GREATER;REVIT2022_OR_GREATER;REVIT2021_OR_GREATER;REVIT2020_OR_GREATER;REVIT2019_OR_GREATER;REVIT2018_OR_GREATER;REVIT2017_OR_GREATER</DefineConstants>
<DefineConstants>$(DefineConstants);REVIT2024_OR_LESS;REVIT2025_OR_LESS</DefineConstants>
</PropertyGroup>
```


## License

This project is [licensed](LICENSE) under the [MIT Licence](https://en.wikipedia.org/wiki/MIT_License).
Expand Down
4 changes: 3 additions & 1 deletion RevitVersion.DefineConstants.Sample/Revit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class Revit2018 { }
public class Revit2017 { }
#endif


#if REVIT2025_OR_LESS
public class Revit2025OrLess { }
#endif
Expand Down Expand Up @@ -87,4 +86,7 @@ public class Revit2018OrGreater { }
public class Revit2017OrGreater { }
#endif
}
#if TEST
public class Test { }
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<RevitVersion>2023</RevitVersion>
<RevitVersion>2024</RevitVersion>
<DefineConstants>TEST</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 6366d7b

Please sign in to comment.