Build everything : even builtByDefault: false - command-line

I have a project that contain lots of references to other qbs file.
Project {
name: "MyProject"
references: ["SubProject1/SubProject1.qbs",
"SubProject2/SubProject2.qbs",
"SubProject3/SubProject3.qbs",
"SubProject4/SubProject4.qbs",
...
]
}
When working in QtCreator, I don't want to always buid everything, so some of the subProject are not built by default :
builtByDefault: false
I also have automated build tools that should built everything to make sure it does build.
The tools run commands like :
/opt/Qt5.5.1/Tools/QtCreator/bin/qbs build -d . -f ../MyProject/MyProject.qbs --job
Problem is this command doesn't build the subProject that are not build by default.
Is there a way to force it to build everything in command line ?

It is explained in the documentation : https://doc.qt.io/qbs/product-item.html
I simply needed to add --all-products
<qbs-folder>/qbs build --all-products -d . -f ../MyProject/MyProject.qbs

Related

No lintable files found at paths SwiftLint

I tried to install SwiftLint using CocoaPods and I add in Build phases the following script :
"${PODS_ROOT}/SwiftLint/swiftlint"
SwiftLint is installed correctly and I get many errors and warnings in the project.
Then, I create the swiftLint.yml file in which I modify some rules but they are not token into consideration and the same number of errors and warnings persist in Xcode project.
When I run this command to confirm the application of the rules :
./swiftlint lint --config .swiftlint.yml
I get the error :
No lintable files found at paths : ''
How can I solve this issue please?
It happens also if you rename the directory of your app, make sure you report the change in the .swiftlint.yml too at first lines :
included: # paths to include during linting
- My_App_Directory
For those of you who used 0.42.0 before and updated to 0.43.0 (or higher?).
They made a change and now interpret included and excluded as relative paths.
Configuration files now consistently have their included/excluded
relative file paths applied relative to their location in the file
system. Previously the root configuration file applied these relative
to the current working directory, but nested configurations applied
these to their location in the file system.
From the release notes of 0.43.0: Clothes Line Interface.
if you are using swiftLint with CocoaPods : try "${PODS_ROOT}/SwiftLint/swiftlint" --config .swiflint.yml in your SwiftLint Run Script in your project build phases.
make sure your .swiflint.yml config file is in the root of your project directory ( beside .xcodeproj file ).
make sure the paths included on your .swiflint.yml (in included: and excluded: sections ) is valid paths
make sure your .swiflint.yml file is valid yaml
don't escape the directory paths in your config file
dont do : - some\ Directorybut do - some Directory without escape character.
If you installed it using Cocoapods this can help you.
I will just merely improve the above answers, to put clarity on how to resolve the issue of SwiftLint not finding the path.
Things to lookout for.
Make sure your swiftlint.yml file is valid.
Make sure the swiftlint.yml is in the same level as your .xcodeproj
Don't specify --path and also add an entry under included: inside your yml file, choose one, either specify the --path or add an entry don't use both otherwise SwiftLint will ignore the --path param, and if the entry specified inside included: is wrong you will get the "no lintable file found" error
In your script.
The gihub page of SwiftLint recommends just using "${PODS_ROOT}/SwiftLint/swiftlint" but that didn't work for me, I had to specify the --path see below for the full script.
"${PODS_ROOT}/SwiftLint/swiftlint" --path "${SRCROOT}/Classes" --config "directory-of-your-config"
The --path param should be your own --path "${SRCROOT}/Classes"
Finally inside the yml file.
Make sure your included and excluded file specification is correct, see how I did mine below.
included:
- Your-Project-Name
excluded:
- Pods
One Important thing to note is if you add directories under included: the --path param will be ignored, and you might possibly get the "no lintable files found" error if the directory is wrong.
First of all, you do not need to add explicitly the--config file if the yml file is in the running directory (from where you are running the command) and name is .swiftlint.yml.
Secondly, you need to specify the path for your source with --path. Below command will work fine in your case,
swiftlint lint --path SourcePath
For swiftlint from version 0.41 the following code worked for me in the build phase (workspace with several projects. Depending on the project configuration, it may be that "../" has to be removed from the path information):
cd ${PROJECT_DIR}/../
"${PODS_ROOT}/SwiftLint/swiftlint" --config "${PROJECT_DIR}/../.swiftlint.yml"
Here is a screenshot of the build phase entry:
Replace autocorrect with --fix
export PATH="$PATH:/opt/homebrew/bin" //This line is only for Apple Silicon chips
if which swiftlint > /dev/null; then
swiftlint --fix && swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
For M1, don't go for swift lint installation VIA PODS instead use Brew.
For installation run below command in Terminal
brew install swiftlint
and add below scripts into RunScript into build phase of your target.
export PATH="$PATH:/opt/homebrew/bin"
if which swiftlint > /dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
If you using pod file then follow this steps:
Run Script: "${PODS_ROOT}/SwiftLint/swiftlint"
This worked for me
if which "${PODS_ROOT}/SwiftLint/swiftlint" >/dev/null; then
${PODS_ROOT}/SwiftLint/swiftlint --fix && ${PODS_ROOT}/SwiftLint/swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

Deploying .NET Core Application with Windows Compatibility Pack

I'm busy deploying a .NET Core 2.1 application into our testing environment, but I'm getting the following error.
Error:
An assembly specified in the application dependencies manifest (MyApp.deps.json) was not found:
package: 'System.Diagnostics.EventLog', version: '4.5.0'
path: 'runtimes/win/lib/netcoreapp2.1/System.Diagnostics.EventLog.dll'
We are using the Windows Compatibility Pack to access the Event Log.
I have the following item in the dependency Json file:
"System.Diagnostics.EventLog/4.5.0": {
"dependencies": {
"Microsoft.Win32.Registry": "4.5.0",
"System.Security.Permissions": "4.5.0",
"System.Security.Principal.Windows": "4.5.0",
"System.Threading.AccessControl": "4.5.0"
},
"runtime": {
"lib/netstandard2.0/System.Diagnostics.EventLog.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.6.26515.6"
}
},
"runtimeTargets": {
"runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.dll": {
"rid": "win",
"assetType": "runtime",
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.6.26515.6"
}
}
}
Please advise how one should deploy these dependencies. Also, what is the root folder to this relative path runtimes/win/lib/netcoreapp2.0?
We actually found a solution for our scenario:
- Our situation was that we tried to run a netcoreapp based test project on our test agent
- dotnet test on the project file worked
- dotnet vstest sometimes worked on the project output directory (we are not sure why and on which setup)
- dotnet vstest did run into the above error when run into an other directory & downloaded from CI
- dotnet vstest did run into an AssemblyNotFoundException on the test agent (which didn't make any sense for us)
The solution was to use dotnet publish for our test project and use the "self-contained" output to run on the test agent. dotnet publish copied the required runtimes/win/lib/netcoreappX.X/*.dll files into the publish output directory.
After a lot of testing, the key issue seems to be the "RuntimeIdentifiers". There is a visible option for this when you publish, but in order to use it when just building you need to add a couple of tags to your .csproj file.
The first is:
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
This will cause NuGet to retrieve the correct dlls (change the value depending on your needs). For me I was compiling to platform x86. I don't know what NuGet was getting by default, but whatever it was had different file sizes for the same files.
You also should then add this tag:
<SelfContained>false</SelfContained>
or else your build will default to copying the entire framework.
Also note that using the RuntimeIdentifier tag will cause your default output folder to include the value you specified. For example my subfolder became:
Project\bin\x86\Debug\netcoreapp3.1\win-86\
For publishing you should be able to do something similar; the problem will be to match your RuntimeIdentifier to your platform. You shouldn't need to specify SelfContained unless you specifically need to.

How do I configure the output-path of ember-cli as a setting?

I'm using ember as part of a bigger project and so both dev and production build into a subdirectory somewhere else. Can I specify output-path as a setting rather than on the commnad line?
You could modify your package.json and add in the scripts there such as:
"scripts": {
"buildprod": "ember build --environment=production --output-path=yourProdPath",
"builddev": "ember build --output-path=yourDevPath"
}
And just run them in the cli npm buildprod.
Create a file named .ember-cli inside the app folder and mention the output path. Ember will recognize the path automatically when we do "ember build"
{
"outputPath" : "D:/MyApplication/working/ember"
}

How to configure PHPUnit with ZF version 1.12.11

I am using zend framework 1.12.11 and now I want to use PHPunit with it.Pear has stopped it's stopped support for phpunit.Now it's working with composer.
I have install composer and phpunit via composer.But Where I have to put composer json setting file and my project and what should include in my project which automatically take phpunit of composer
Per the PHPUnit documentation for Composer installation, add PHPUnit to the dependencies in your project's composer.json file, something like:
{
"require-dev": {
"phpunit/phpunit": "4.6.*"
}
}
Then run:
composer update -vvv phpunit/phpunit
to actually bring PHPUnit and its dependencies down into your project.
I usually add the -vvv (maximally verbose) flag to see what's going on under the hood. Feel free to omit if you prefer.
Once they are all installed, you can run phpunit the usual way by accessing the executable bin script that PHPUnit and Composer expose for you. From the project root, you should be able to run:
./vendor/bin/phpunit --version
to confirm the install is ok.
Once you have a phpunit.xml config file set up that your test suites and directories, you should be able to run your tests using:
./vendor/bin/phpunit -c /path/to/phpunit.xml

specifying nuget package sources

My build server fails to build because the package source cannot be found. Here's how I want to specify it:
<PackageSources><add key="My Feed" value="http://tfs2010:90/CompName.Nuget.Web.$(Configuration)/Nuget" /></PackageSources>
The error:
C:\TFS2010\TFS\Nuget\nuget.Other.targets (43): The command ""C:\tmp\nuget.exe" install "C:\Builds\1\PC\PackNameSources\PackName\packages.config" -source -o "C:\Builds\1\PC\PackName\Sources\packages"" exited with code -1.
Now, of course if I do that:
<PackageSources>"http://tfs2010:90/MyFeed/Nuget"</PackageSources>
then it works fine.
The problem is that eventually, I want to specify multiple sources.
How can I do that and what am I doing wrong ?
the solution was to separate the sources with a semi-colon :
<PackageSources>"source1; source2"</PackageSources>