Could someone translate this, into a syntax that uses the built in variables?
\\myserver\builds\mybuild\Daily_20090525.1\Release\_PublishedWebsites\myWebsite
it should be something like:
$(DropLocation)\mybuild\$(?...)\Release\_PublishedWebsites\myWebsite
This might help:
substitute "mybuild\$(?...)" with "$(BuildNumber)"
I had a similar problem where I was trying to copy from the drop location to a "Latest" folder. I found that to construct the final destination of the files (\MyServer\MyShare\builds\MyBuild\Daily_20090708.14\Mixed Platforms\Release) translated to the following using variables:
$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.PlatformToBuild)\%(ConfigurationToBuild.FlavorToBuild)
I also found it helpful to use the Message task for troubleshooting. The following task will tell you what the variable translate to.
<Message Text="$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.PlatformToBuild)\%(ConfigurationToBuild.FlavorToBuild)\"/>
To see the output, look in BuildLog.txt.
PS: My tasks that used the properties and items mentioned above where located inside <Target Name="AfterDropBuild">.
Related
I use SQLFluff to ensure a uniform syntax in the company and reduce error warnings before running the models in dbt. Since our syntax does not completely match the syntax of SQLFluff I would like to make some changes.
The Rules References provided by SQLFluff helped me to set up Inline Ignoring Errors, as displayed in the code below (last line of code).
So I have two questions, which I was not able to answer also with the help of the Rules References of SQLFluff.
I would like to set Rule L032 as default 'false' without typing it manually every time in my SQL.
How do I change the maximal length of a line regarding Rule L016? I would like to set the default value e.g. 150.
SELECT
country.country_name,
country.population,
currency.currency_name,
currency.currency_id,
currency.strange_long_variable_name_which_is_too_long as not_so_long_variable_name
FROM country
LEFT JOIN currency
USING (country) -- noqa: L032
I tried to figure it out with the Rules References but could not figure it out. Help is very much appreciated!
Try looking into .sqlfluff config file
https://docs.sqlfluff.com/en/stable/configuration.html#
With the help of #suhprano's answer, I was able to find the proper solution for my issue. For this reason, I will post an answer to my own question. I do this intending to provide others assistant with similar issues.
I created the .sqlfluff file in my user profile folder. In this file I have then included the following:
[sqlfluff]
exclude_rules = L032
[sqlfluff:rules]
max_line_length = 150
In this case, SQLFluff will load the configuration from any .sql file found at the path specified on this variable.
Just an addition to the answer:
The default config of the rules can be found inside the package in file core\default_config.cfg
See also:
https://github.com/sqlfluff/sqlfluff/blob/main/src/sqlfluff/core/default_config.cfg
https://docs.sqlfluff.com/en/stable/configuration.html#defaultconfig
As already mentioned by #Albin the easiest way to override the config is to add a .sqlfluff file in the user profile folder.
See also:
https://docs.sqlfluff.com/en/stable/configuration.html#rule-configuration
After some time I spent staring at the jbake code, I figured out that if I declare my own property in jbake.properties :
...
foo=bar
...
I can reuse that in files that go through a template engine by referencing it as ${config.foo}. I'd like to have this substitution working also on the content lvl, i.e. for files written in asciidoc, living inside the content directory.
Is there any non-trivial way to achieve it? How can I make the templating engine to proccess the result of asciidoc parses engine, or make it running it before the asciidoctor?
I found the answer myself.
To use the property substitution in asciidoc files, add following to the jbake.properties:
...
asciidoctor.attributes.export=true
foo=world
...
and reference the variable in aFile.adoc this way:
Hello {foo}!
is it possible to call/reference functions in another query file beside MyExtensions in LinqPad?
You can call one script from another:
Another way to combine scripts is to dynamically execute one script from another. The Util.Run method does exactly that, and is useful in both interactive and command-line scenarios:
string htmlResult = Util.Run ("test.linq", QueryResultFormat.Html).AsString();
Note: If you feed Util.Run a relative path, it will resolve it relative to the 'My Queries' directory rather than the current directory. You can switch its behavior by specifying .\test.linq instead of test.linq in this example.
From:
LINQPad Command-Line and Scripting
No, this isn't possible right now.
Is there anyway to modify each item in an item group? For example, given this item:
<_CustomAreas Include="..\My.Project.*\Areas\**\*.*" Condition="'$(AppBuildFolder)' == ''" />
I want to remove the "..\My.Product.* portion. Basically we have separate project containing MVC areas, and in the Package / Deployment (MSDeploy) we want to copy them into the main project. Here's where the group is used:
<FilesForPackagingFromProject Include="%(_CustomAreas.Identity)">
<DestinationRelativePath>Areas\%(relativedir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
$(relativedir) is coming through as "..\My.Project.Plugin1\Areas**." and it ends up in the package as ZipFileRoot\My.Project.Plugin1\Areas (The .. backs out of the hardcoded Areas, and then it just creates the folder for the plugin\areas) where I'd like it to actually all end up in ZipFileRoot\Areas.
Thanks
Andy
The RegexReplace (credentials: guest/guest) task should be able to match \My.Product.* and replace with an empty string.
Something like this should work: (untested, need to verify escaping)
<RegexReplace Input="%(_CustomAreas)" Expression="\\My\.Product\..*" Replacement="" Count="-1">
<Output ItemName="_CustomAreas" TaskParameter="Output" />
</RegexReplace>
There's a little work getting the MSBuild Community Tasks up and running, but enough good stuff in there for me to find it worth the effort.
With MsBuild 4.0 You can use String methods directly in your script (or use inline tasks). With this option, you can edit your relativedir to delete the My.Project.* part .
You can see examples in this article : http://sedodream.com/2010/03/07/MSBuild40PropertyFunctionsPart1.aspx
Items in ItemGroups can have an Exclude attribute that allows you to specify items to leave out.
This is probably a really stupid MSBuild question but if I have
<ItemGroup>
<Dll Include="<Path_to_DLLs>\*.dll" />
</ItemGroup>
And then
<SomeTarget useFiles=#(Dll)>
....do stuff
</someTarget>
What I want to do is to output the current item that #(Dll) is looping through. Basically I wanting to output the name of the current DLL being acted on.
I think this must be possible and it is probably so simple but it is driving me nuts!
Aha The joys of metadata.
On the creation of every item in MSBuild, specific MetaData is assigned to it.
In this case I could use %(Filename) to retrieve the file name
This is a full list of Well Known metaData