Nuget Pack Default Option Values - nuget

I'm trying to make it so that when I run nuget pack it always outputs to the same directory, rather than typing it in every time. The following link suggests that defaults are possible by setting config file key/value pairs.
http://docs.nuget.org/docs/reference/nuget-config-file
However, there doesn't seem to be a clear syntax. I've tried using keys such as:
OutputDirectory
DefaultOutputDirectory
DefaultPackOutputDirectory
None of which worked. Maybe the "DefaultPushSource" is a hard-coded key in the executable? Is it even possible to set default values for pack options using the config file approach?

here is the list of settings that can be defined in the nuget.config: http://docs.nuget.org/docs/reference/nuget-config-settings
There is no nuget.config settings for nuget.exe pack command yet.

#Chad H : There is no way to do this right now. The best way I can recommend is to create an alias for the nuget pack command which has the outputDirectory flag set to whatever path you want your output at :
https://docs.nuget.org/consume/command-line-reference#pack-command

Related

Codemagic - Set Dynamic Environment Variables for the Build arguments

I am looking a way to manage dynamic environment variables in my build arguments.
I am able to make it work if I define values for TARGET_FILE and FLAVOR in the environment variable section in CodeMagic.
But my goal is to have the values specified in my git repository. So I will be able to change it and have a dynamic build.
I was thinking I would be able to set the env var in the pre-build section.
Following is a sample of my pre-build.sh file
# in my case it’s `dev`, `qa` and `prod`
export FLAVOR='qa'
# major and minor part of app version e.g. 1.0
export VERSION_NUMBER='1.0.0'
# this is the entry point of the app e.g. main_dev.dart
export TARGET_FILE="lib/main_$FLAVOR.dart"
My build is still failing because the TARGET_FILE for example is not specified
Target file "--flavor" not found.
Build failed :|
Failed to build for Android
I was wondering if anyone has ever encountered this scenario
As for configuring build from GitHub you can use codemagic.yaml file that allows you to define the configuration for CodeMagic build, including env variables (here is a docs).
Additional notes, just a proposition))
I actually don't know what is going on in your Flavors and env entry points, but quite possible you can actually get rid of both.
For instance, you can use .env file and flutter_config package to pass env specific variables to the native layer, including plist's and Gradle. Also, you can load this .env file into Dart code and use variables from it. On top of this, you can use this package to generate .env file with the terminal command (if you don't want to create any sh scripts))). Alongside with .env file, it can generate Dart class specifically for Dart code. It also can generate files based on global env variables.
In that way all environment specific configuration will be defined once, you won't expose your prod credentials anywhere except build tool and you won't need to copy/paste multiple entry points.
Update 08/05/2020:
Starting from Flutter 1.17 you can use --dart-defines argument instead of environment_config and flutter_config package to define compile-time variables. You can read more about this argument here

Override nuspec variable from TeamCity

I've already overridden the version number in the nuspec through the build steps in TeamCity (Nuget Pack), but I don't know how to override any specific variable - is it only possible with the Command Line Parameters or is it possible to expand it in some way so that a new parameter is possible in the build step (as is with the version parameter)?
If only through the command line, do any have suggestions? I guess a path is needed as with the Package Parameter, but other than that I'm lost.
I think that Properties field is what you're looking for:
According to the docs, it can contain:
Semicolon or new-line separated list of package creation properties.
For example, to make a release build, you define here
Configuration=Release.
I've highlighted the term package creation properties as this is the out-of-the-box mechanism to pass parameters to the NuGet package creation process.

NuGet -ConfigFile option supersedes %ProgramData% config file

According to the NuGet documentation, you should be able to specify a custom config file while still using any additional config files that are located in %ProgramData%\Nuget\Config. However, that doesn't seem to be the case. If I specify a custom config file, any config file I have in %ProgramData% is unused:
C:\> nuget.exe sources
(output includes sources specified in my %ProgramData%\Nuget\Config\A.config)
C:\> nuget.exe sources -ConfigFile B.config
(output includes sources specified in B.config but not in ProgramData%\Nuget\Config\A.config)
As a matter of fact, if I specify the -ConfigFile option, I can even put xml errors in A.config and it doesn't complain at all.
Has anyone else run into this?
I re-posted this at the NuGet site, and it looks as if there was an intentional change in behavior in version 3.4.
https://github.com/NuGet/Home/issues/2812

Netbeans, phpdocumentor, and custom phpdoc.dist.xml by project

I am using Netbeans 8.0.2 and phpdocumentor 2.8.2 on a windows 7 platform.
I would like to use custom phpdoc.dist.xml config files by project so I can specify framework directories and etc. to exclude from the generated doc. I also want to keep my Netbeans PHPDOC plugin config as generic as possible, without specific output directories, ignore options, config path parameters, etc., so on, so that that the config will apply to all my projects.
The phpdoc.dist.xml file works great. The doc generated is exactly what I want.
The problem or feature, and it seems to be a phpdocumentor one as it also applies from plain command line, is that the phpdoc.bat command (without a specific config parm) has to be run from the same root directory as the phpdoc.dist.xml file, or it ignores it. No problem if I'm using command line as I can change into that directory first, but I would like to use Netbeans. I have searched on this extensively and cannot find an answer.
I considered whether to modify the phpdocumentor files to insert cd /D path/to/myproject/dir to change the directory using some Netbeans variable to represent myproject/dir, but I could not find the right place in the code or the variable to use. Plus, then I'm supporting a custom mod to phpdocumentor.
I did find these directions for a PHPStorm setup, where the author specified a PHPStorm variable for the --config command line option to point to his custom phpdoc.dist.xml.
--config="$ProjectFileDir$/phpdoc.dist.xml"
If I could do the same in Netbeans like maybe "${BASE_DIR}/phpdoc.dist.xml" it would be great, but so far I haven't hit on anything Netbeans will recognize/pay attention to in the PhpDoc script: box.
I have also tried writing a wrapper .bat file to capture my own command line variable %1 and do the directory change to that before calling phpdoc.bat, but Netbeans throws and error and says that's not a valid .bat file. I cannot find any phpdocumentor parameter to configure by specific Netbeans project but the output directory. And I would prefer not to be defining a bunch of projects on subdirectories in Netbeans, just to address phpdocumentor.
Now I am out of ideas. Can anyone point me to a solution?

Get a list of all change packages of a MKS project

I am trying to automatize some tasks of MKS Integrity via command line. Since we are forced to use the change package feature, I try to get a list of all change packages of a single MKS project. How can this be achieved?
I already checked the command line references of 'si' and 'im', but I still have no idea how to get such a list. The only thing I already got to work was a list of change packages from 'si rlog'. Here I could parse the output and drop all duplicate entries. But the problem is, that I only get change packages from files, currently available in the project. Change packages affecting deleted files are not included.
To look up change packages by project use the following command:
si viewcps --filter=project:"c:/path_to_project/project.pj"
Note that the slashes are forward, not backwards like Windows uses.
There are also different fields and formats available, not just the default ones. if you run man "si viewcps" at the command prompt, it will give you a list of fields you can use with the optional --fields tag to output additional information.
Output can be modified to limit results to CP type, state, target, etc. man "si viewcps" gives details on how to use these options as well.