Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit de73010

Browse files
committed
build: detangle buildSrc
Build structure and tasks revamped See manual/src/docs/tutorials/howto-build-system.txt
1 parent 42e2b7c commit de73010

File tree

157 files changed

+2864
-1685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+2864
-1685
lines changed

build.gradle

+2-9
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,7 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
import org.apache.polygene.gradle.AllProjectsPlugin
19-
import org.apache.polygene.gradle.RootProjectPlugin
20-
import org.apache.polygene.gradle.dependencies.DependenciesDeclarationPlugin
2118

22-
apply plugin: DependenciesDeclarationPlugin
19+
apply plugin: 'polygene-dependencies-declaration'
2320
apply from: 'dependencies.gradle'
24-
25-
allprojects {
26-
apply plugin: AllProjectsPlugin
27-
}
28-
apply plugin: RootProjectPlugin
21+
apply plugin: 'polygene-root'

buildSrc/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ repositories {
2828
dependencies {
2929
compile gradleApi()
3030
compile localGroovy()
31-
compile 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2'
32-
compile 'gradle.plugin.org.nosphere.honker:honker-gradle:0.2.3'
31+
compile 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.0'
32+
compile 'gradle.plugin.org.nosphere.honker:honker-gradle:0.3.0'
3333
compile 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
34+
compile 'org.apache.httpcomponents:httpclient:4.5.2'
35+
compile 'org.apache.httpcomponents:httpmime:4.5.2'
3436

3537
testCompile 'junit:junit:4.12'
3638
testCompile( 'org.spockframework:spock-core:1.0-groovy-2.4' ) { exclude module: 'groovy-all' }

buildSrc/src/main/groovy/org/apache/polygene/gradle/AllProjectsPlugin.groovy

-214
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.polygene.gradle
19+
20+
import groovy.transform.CompileStatic
21+
import org.apache.polygene.gradle.dependencies.PolygeneExtension
22+
import org.apache.polygene.gradle.structure.release.ReleaseSpecPlugin
23+
import org.gradle.api.Plugin
24+
import org.gradle.api.Project
25+
26+
/**
27+
* Plugin applied to all Polygene projects.
28+
*/
29+
@CompileStatic
30+
class BasePlugin implements Plugin<Project>
31+
{
32+
@Override
33+
void apply( Project project )
34+
{
35+
applyGroup project
36+
applyVersion project
37+
project.plugins.apply ReleaseSpecPlugin
38+
applyPolygeneExtension project
39+
project.defaultTasks 'classes', 'test'
40+
}
41+
42+
private static void applyGroup( Project project )
43+
{
44+
project.group = project.path == ':' ?
45+
'org.apache.polygene' :
46+
"org.apache.polygene.${ project.path.split( ':' ).drop( 1 ).dropRight( 1 ).join( '.' ) }"
47+
}
48+
49+
private static void applyVersion( Project project )
50+
{
51+
if( project.version == 'unspecified' )
52+
{
53+
project.version = System.properties.version ?: '0'
54+
}
55+
}
56+
57+
private static void applyPolygeneExtension( Project project )
58+
{
59+
project.extensions.create 'polygene', PolygeneExtension, project
60+
}
61+
}

0 commit comments

Comments
 (0)