gradle.build and init.gradle configurations?
I want to build locally instead of using a repository so should my code look like below? (NOOB TO CODING)
gradle.build repositories{
mavenCentral() }
task showRepositories << {
repositories.each{
println “repository: $init.gradle (’$C:\gradle-1.10\DB_Support_v.1.05.00.01’)”
} }
init.gradle (wanted to convert from maven to gradle so was wondering if i was on the right track) (also put init.gradle in project folder)
import org.gradle.api.artifacts.repositories.ArtifactRepository import org.gradle.api.artifacts.repositories.MavenArtifactRepository
apply plugin:EnterpriseRepositoryPlugin
class EnterpriseRepositoryPlugin implements Plugin {
private static String ENTERPRISE_REPOSITORY_URL = “http://repo.gradle.org/gradle/repo”
void apply(Gradle gradle) {
// ONLY USE ENTERPRISE REPO FOR DEPENDENCIES
gradle.allprojects{ project ->
project.repositories {
//remove all repositories not pointing to the enterprise repository url
all { ArtifactRepository repo ->
if (!(repo instanceof MavenArtifactRepository) || repo.url.toString() != ENTERPRISE_REPOSITORY_URL) {
project.logger.lifecycle “Repository ${repo.url} removed. Only $ENTERPRISE_REPOSITORY_URL is allowed”
remove repo
}
}
// add the enterprise repository
maven {
name “STANDARD_ENTERPRISE_REPO”
url ENTERPRISE_REPOSITORY_URL
}
}
}
} }