0

I would like to use some library in Gradle build tasks and wrote:

buildScript {
    dependencies {
        classpath files('lib/matlabcontrol-4.1.0.jar')
    }
}

according to https://stackoverflow.com/a/26314875/258483

Unfortunately, it does not work with error:

Could not find method buildScript() for arguments [build_dequiq884i95u7leo8gt9c8xk$_run_closure1@5a63dd5b] on root project

How to fix and why it was answered as working method in referenced answer?

Community
  • 1
  • 1
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385

1 Answers1

1

Try this change buildScript to buildscript

buildscript {
    dependencies {
        classpath files('lib/matlabcontrol-4.1.0.jar')
    }
}
WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
Abhishek
  • 3,348
  • 3
  • 15
  • 34
  • Is it possible to declare a task dependency ? For example, I have a task which publish a message to RabbitMQ Broker so I need RabbitMQ Java driver to do so. – Guerino Rodella Nov 17 '17 at 11:33
  • I know how to define task in gradle. You will get more information on net. In that you can write your own logic. For basic you can start from https://www.tutorialspoint.com/gradle/gradle_tasks.htm – Abhishek Nov 17 '17 at 11:45