# projectsLoaded

abstract fun projectsLoaded(closure: Closure)(source)

Adds a closure to be called when the projects for the build have been created from the settings. None of the projects have been evaluated. This `Gradle` instance is passed to the closure as a parameter.

An example of hooking into the projectsLoaded to configure buildscript classpath from the init script.

    //init.gradle
    gradle.projectsLoaded {
      rootProject.buildscript {
        repositories {
          //...
        }
        dependencies {
          //...
        }
      }
    }

Content copied to clipboard

#### Parameters

closure

The closure to execute.

abstract fun projectsLoaded(action: Action<in Gradle>)(source)

Adds an action to be called when the projects for the build have been created from the settings. None of the projects have been evaluated.

#### Since

3.4

#### Parameters

action

The action to execute.