1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.support; 18 19import org.gradle.api.Project 20 21/** 22 * Extension for {@link SupportLibraryPlugin}. 23 */ 24class SupportLibraryExtension { 25 Project project 26 String name; 27 String description; 28 String inceptionYear; 29 Collection<License> licenses = []; 30 31 SupportLibraryExtension(Project project) { 32 this.project = project 33 } 34 35 License license(Closure closure) { 36 def license = project.configure(new License(), closure) 37 licenses.add(license) 38 return license 39 } 40 41 class License { 42 String name; 43 String url; 44 45 void url(String p) { 46 url = p 47 } 48 49 void name(String p) { 50 name = p 51 } 52 } 53}