Sorry For Inconvenience, Site is Under Maintenance. Please Goto HomePage

Gradle - Fabricating Systems FP Handson Solutions

Gradle - Fabricating Systems FP Handson Solutions
Notes Bureau
Gradle - Fabricating Systems FP Handson Solutions

Disclaimer: The main motive to provide this solution is to help and support those who are unable to do these courses due to facing some issue and having a little bit lack of knowledge. All of the material and information contained on this website is for knowledge and education purposes only.

Try to understand these solutions and solve your Hands-On problems. (Not encourage copy and paste these solutions)

Gradle - Fabricating Systems FP Handson Solutions

Course Path: Mobility & Wearables/BUILD TOOLS/Gradle - Fabricating Systems


1.Try it out - Fibonacci Sequence
Welcome to Gradle program to generate Fibonacii series

File Name - build.gradle

def fib(n)
{
  int first_num = 1
  int second_num = 1
  if(n==1)
  println first_num
  else if(n==2)
  println first_num + " "+second_num
  else if (n > 2)
  {
    print first_num + " "+second_num
    int i = 3
    while(i<=n)
    {
      int z = first_num + second_num
      print " "+z
      first_num = second_num
      second_num = z
      i = i+1
    }
  }
}
task fibo(){
  doLast
  {
    int n = Integer.parseInt(num)
    println "First"+n+"fibonacci numbers:"
    fib n
  }
}




2.Try it out - Play with Dependencies
Welcome to Gradle program to define dependency tasks

File Name - build.gradle

project(':projectA'){
  task hello
}
task hello
println tasks.getByPath('taskA').path
println tasks.getByPath('independent task').path
println tasks.getByPath('taskB').path
println tasks.getByPath('dependent on taskA').path



3.Exercise to Build Java Project
Welcome to Gradle program to calculate area of circle and square

File Name - build.gradle

task circle {
  doLast {
    double area = (22/7)*Double.parseDouble(radius)*Double.parseDouble(radius)
    println 'area of circle is = '+area
  }
}
task square {
  doLast {
    double area = Double.parseDouble(side)*Double.parseDouble(side)
    println 'area of circle is = '+area
  }
}



إرسال تعليق

Any comments and suggestion will be appreciated.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.

Join Telegram Channel

Join Notes Bureau Lets Teach and Learn

Join Telegram Channel
CLOSE ADS
CLOSE ADS