dotnet-accelerator's People
dotnet-accelerator's Issues
Ideas for simplifying accelerators.yaml
After looking at the machine generated accelerator.yaml
file in a bit more detail, I think the following recipes could be used to make it more "natural" (and concise):
- All of the preprocessor
#if x #endif
directives could be replaced by aReplaceText
withregex
, e.g. like so:
- include:
- src/MyProjectGroup.Common/MyProjectGroup.Common.csproj
chain:
- type: ReplaceText
substitutions:
- text: |2-
<!--#if configserver -->
<PackageReference Include="Steeltoe.Extensions.Configuration.ConfigServerCore" Version="3.1.3" />
<!--#endif -->
with: "''"
condition: '!(#configserver)'
- type: ReplaceText
substitutions:
- text: |2-
<!--#if configserver -->
<PackageReference Include="Steeltoe.Extensions.Configuration.ConfigServerCore" Version="3.1.3" />
<!--#endif -->
with: "' <PackageReference Include=\"Steeltoe.Extensions.Configuration.ConfigServerCore\" Version=\"3.1.3\" />'"
condition: '#configserver'
becomes
- include:
- src/MyProjectGroup.Common/MyProjectGroup.Common.csproj
chain:
- type: ReplaceText
regex:
pattern: '(?s)<!--#if configserver -->(.*?)<!--#endif -->'
with: "#configserver ? '$1' : ''"
but then of course, there is no need to have this snippet per file, so the include can become
- include: ['**/*.csproj', '**/*.xml']
and handle all files in one swoop.
You're then left with one snippet per option + comment format (xml-like, C-like, etc.)
I believe this can apply to lines 70 to 800 and scale with the number of options instead of the number of files to touch.
If you're adventurous, this could be reduced to one snippet per option if you make the regex cope with all comment styles.
- Then, all the
RewritePath
of the form
- type: RewritePath
regex: config/DotnetAccelerator-Development.yaml
rewriteTo: "'config/' + #artifactId + '-Development.yaml'"
- type: RewritePath
regex: config/DotnetAccelerator-LocalMySQL.yaml
rewriteTo: "'config/' + #artifactId + '-LocalMySQL.yaml'"
etc...
can be rewritten to a couple of RewritePath
using capturing groups:
- type: RewritePath
regex: (config/)DotnetAccelerator(-Development\\.yaml)
rewriteTo: "#g1 + #artifactId + #g2"
etc...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.