Gradle build: does someone tried alternative build script with alternative setting.gradle? - build

I am using gradle 1.4, and renamed a build.gradle to buildExpr.gradle and settings.gradle to settingExpr.gradle, both files are in the project root, and I am using following command to run gradle build.
'gradle C:\myProject>gradle -i -b buildExpr.gradle -c settingsExpr.gradle project'
it seems command line option '-c' is not being honored and gradle is not picking settingsExpr.gradle file, hence it is not able to display all modules defined in settings.gradle file while executing project task.
I am getting following log
-------------------------------------LOG----------------------------------------------------
C:\ASM\asm_workspace\asm71\AutoLab>gradle -i -c settingsExpr.gradle -b buildExpr.gradle project
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file 'C:\ASM\asm_workspace\asm71\AutoLab\buildExpr.gradle'.
Included projects: [root project 'AutoLab']
Evaluating root project 'AutoLab' using build file 'C:\ASM\asm_workspace\asm71\AutoLab\buildExpr.gradle'.
All projects evaluated.
Selected primary task 'projects'
Tasks to be executed: [task ':projects']
:projects
Root project
Root project 'AutoLab'
No sub-projects
it is very strange behavior by gradle command line shows. but if I change buildExpr.gradle to build.gradle and settingsExpr.gradle to settings.gradle, it executes normally and shows all sub-modules in log

-b and -c can't be used together. When using a settings file, everything else (e.g. the locations of build files) is determined from the settings file.

Related

Different target names using Rust Cargo for build

Is there a way to set different target names for development and release configurations using Cargo for building? For example, rustlibd.a and rustlib.a?
No. Debug vs release information is controlled by a profile. You can see all the profile-related manifest keys in the source code. The only related one I see is rustc_options. Running the build in verbose mode, you can see how cargo calls rustc:
$ cargo build --verbose
Compiling namez v0.1.0 (file:///private/tmp/namez)
Running `rustc --crate-name namez src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=5444c772a04e08f3 -C extra-filename=-5444c772a04e08f3 --out-dir /private/tmp/namez/target/debug/deps -L dependency=/private/tmp/namez/target/debug/deps`
Finished dev [unoptimized + debuginfo] target(s) in 0.45 secs
Unfortunately, changing --crate-name does not have the effect you'd like.
Instead, I'd point out that you already have a different filename, you just have to look broader:
target/debug/libname.a
target/release/libname.a
The debug and release files are in different directories. Whatever you were going to do to move separately named libraries would have to deal with the debug and release directories anyway. Just update your script:
mv target/debug/libname.a libnamed.a
mv target/release/libname.a libname.a

WSIG Deployment BUILD FAILED

I would like to use wsig : I followed the guide .
So in step of deployement:
Prepare the WSIG web application content in the webModule directory. This step can be performed by means of the build target of the ANT build file included in the WSIG distribution.
When I launch the command ANT like this :
c:\JADE-all-4.5.0\add-ons\wsig>ant build.xml
it's displays this error :
buildfile: C:\Users\acer\Downloads\JADE-all-4.5.0\add-ons\wsig\build.xml
BUILD FAILED
Target "build.xml" does not exist in the project "wsig".
I checked the folder wsig , build.xml file exists in wsig folder.
Try this instead.
>ant -f build.xml
If you need to specify a target in the build.xml file then put that on the end. For example -
ant -f build.xml mytarget
See here for more information.

Using Travis CI to compile c++ project

i'm new at Travis CI and I want to ask you how to exactly use Travis CI to compile OpenGL with a lot .cpp, .h files. If you can hint me how to create correct .travis.yml file.
Also I tried to this but i'm getting this error:
The command "./configure && make" exited with 127.
/home/travis/build.sh: line 41: ./configure: No such file or directory
.travis.yml file:
language: cpp
compiler:
- gcc
- clang
Change this to your needs
script: ./configure && make
There must be a 'configure' file in the directory where the build starts. It is possible that you are using autotools, and need to run ./autogen.sh or autoreconf first, which generates the configure file. It is possible you are integrating travis with github, and your repository has a .gitignore that ignores the configure file (as it should) so that there is no configure file in the repository (only in your build directory on your dev machine.)

Why settings.gradle file is not used when -b is specified?

From Gradle User Guide we can read that
You can use the -b option to select another build file. If you use -b option then settings.gradle file is not used.
So lets have:
-Example #Project root
--src
--main
--test
--build.gradle
--second.gradle #Second build script
--settings.gradle
What is the purpose of this? If I want to try something different with my multiproject build I create another script file - second.gradle and put it in the same directory. But want old settings.gradle file to include my subprojects.
If I execute my gradle comands when I am in the root directory of Example project for ex:
gradle -b second.gradle clean build
Why Gradle does not use settings.gradle file? To protect itself when specified build file is not in the same dir, because Gradle will looks for settings.gradle in the direcotry of build.gradle file and after that in the parent directory. But they can empty or can be from another project?
-b allows to pass a different build script for a single-project build. It is not meant to be used for multi-project builds, where settings.gradle alone determines where build scripts are located.

How to pass build.gradle directory to gradlew?

./gradlew can be run in the same directory as the build.gradle file, but how can I run gradlew (standard Gradle wrapper) from another directory? For Make, one can pass "-C DIRECTORY" to "Change to DIRECTORY before doing anything.". Is there an equivalent parameter in Gradle?
Just found it from Appendix D. Gradle Command Line.
The answer is -p <your project directory>, which defaults to the current directory.