Parallel build execution in gradle - build.gradle

Current scenario:
current build.gradle is taking 2 hours to complete all tasks.
What i want to achieve:
i want to reduce the build time.
What i have done till now:
i have created multiple projects in below hierarchy:
:root project
settings.gradle
- rootProject.name = 'creating-multi-project'
- include child1
- include child2
- include child3
properties.gradle
- org.gradle.parallel=true
- org.gradle.max
:child1
- build.gradle
:child2
- build.gradle
:child3
- build.gradle
How i can confirm my tasks are running in parallel?
Tasks are running but i am not sure these are running in parallel or not.

Current scenario
current build.gradle is taking 2 hours to complete all tasks.
What i want to achieve: i want to reduce the build time.
What i have done till now: i have created multiple projects in below hierarchy:
:root project
settings.gradle
- rootProject.name = 'creating-multi-project'
- include child1
- include child2
- include child3
properties.gradle
- org.gradle.parallel=true
- org.gradle.max=4
:child1
- build.gradle
:child2
- build.gradle
:child3
- build.gradle
How i can confirm my tasks are running in parallel? Kindly share your ideas/thoughts.
Tasks are running but i am not sure these are running in parallel or not.

Related

Angular Storybook cypress tests failing on Azure pipelines during build

I have a libs component project. Recently we updated to Angular 14 to Angular 15
Locally when i run npm run storybook:cypress - all works fine and tests have passed.
But when the tests are run on Azure on pull request - they fail with next error:
The injectable 'PlatformLocation' needs to be compiled using the JIT compiler, but '#angular/compiler' is not available.
And i totally have no idea what is wrong, all similar information in the Web is related to updating Angurlar to 13 version.
What i'm trying to say, if the configs were wrong, then it would fail already on Angular 14. Where i should start digging?
I have tried:
removing angularCompilerOptions from TSconfig.lib.json ( prod also )
adding compilationMode = full instead of current partial from TSconfig.lib.json ( prod also )
checked that test-setup.ts imports 'jset-preset-angular/setup-jest' instead of simple setip-jest
I have checked that PlatformLocation is not used somewhere incorrectly, e.g. imports component instead of module ( but my code doesn't use that at all )
Project structure is next:
apps
--myproject-e2e
----src
----cypress.json
----tsconfig.json
libs
--myproject
----src
----package.json
----tsconfig.json
----tsconfig.lib.json
----tsconfig.lib.prod.json
package.json
angular.json
jest.config.json
jest.preset.json
tsconfig.json
tsconfig.base.json

GitHub Actions Ignore Certain Files Inside a Directory

I have a project where I use GitHub Actions. I now need to ignore certain file changes inside certain folders. Here is my project structure:
masterDir
- contentDir
- dir1
- file1.ignore.md
- file2.md
- dir2
- file3.md
- file4.ignore.md
So I would like that my GitHub actions are not triggered for any changes to any file that has ignore.md in its file name. So here is what I came up with, but that does not seem to work.
on:
push:
paths-ignore:
- 'README.md'
- 'backup/**'
- 'masterDir/contentDir/**/*.draft.md'
Any ideas on what is wrong with my wildcard match?
It was indeed quite simple to do. All I have to do is the following:
on:
push:
paths-ignore:
- 'README.md'
- 'backup/**'
- '**/*.draft.md'
As a reference, here is the documentation in detail: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#patterns-to-match-file-paths
As it can be seen from the documentation that the wildcard matches any file in any folder that contains a .draft.md match.

How to get the checkout directory of project dependencies in TeamCity?

I am using TeamCity as build server and have a little trouble when configuring projects and their dependencies.
Eventually I want to get the checkout directory of project dependencies to configure certain build steps. For that I have the variable %teamcity.build.checkoutDir% for the checkout directory of the project itself.
However, I did not find something like %dep.<dependencyID>.teamcity.build.checkoutDir%.
Is there a way to get the checkout directory of a dependency?
You can add a parameter (say checkoutDir ) in the first build whose value is equal to %teamcity.build.checkoutDir% . You can then fetch this value in the dependent build (either through snapshot or artefact dependency)
I am using this myself and I can access my dependent Build's Checkout directory with...
%dep.<dependecyID>.teamcity.build.default.checkoutDir%
I believe this will only work with a Snapshot Dependency though

Gradle Splitting up Testing Tasks with File Structure

I'm trying to make my tasks run tests in a certain directory. I was looking at sourceSets, however I inferred that they are useful if you are running outside the test/groovy folder. All of my tests are within the test/groovy folder.
I've got a set of Geb tests as well as a set of service tests. I would like to run them both together and independently. Essentially my tree structure would look like this, being able to run all tests.
Test
--gebTest
----firefoxTest
----chromeTest
----ieTest
--servicesTest
----service1Test
----service2Test
----service3Test
----etc.
My file structure is as follows:
project
-src
--test
---groovy
----com
-----acme
------functional <---where my geb tests sit
------services <---umbrella for services
-------service1 <---each unique service
-------service2
-------service3
-------etc
Can anyone lend me a hand. For the life of me I don't know how Gradle picks what tests to execute.
Thank you in advanced.
SourceSets are indeed a solution to your problem, but I notice you only differentiate your tests by their package names. I'm not sure but that may prove problematic with source sets.
Personally I would prefer a directory structure like this anyway
src
-test
--groovy
---functional
----com etc
---services
----com etc
However, if you are attached to your current structure then take a look at Gradle's test filtering support, which will allow you to filter by package name.
http://www.gradle.org/docs/current/userguide/java_plugin.html#sec:java_test

hudson to build only changed project

I have a requirement to build only changed project in hudson. We have out repository structure as
Projects/
------- Project A/src
------- Project B/src
------- Project C/src
We have arount 100+ indipendent projects in
I have a job configured in hudson which monitors the entire projects folder for changes (svn update).
What I'm trying to achieve is to build only the project which gets changed by passing the project name as argument for my build script
like ..... ant Project B ( upon changes in projectB). Is this feasible? Please guide me through.
Thanks