Skip to content

Commit

Permalink
Added staticdocs module
Browse files Browse the repository at this point in the history
- Removed a bunch of gradle apply language plugins
- Reverted gralde idea copyright generation from copyright file
  • Loading branch information
adrianbk committed Apr 9, 2015
1 parent 60ba8dd commit b384456
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 15 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ SoftwareVersion currentVersion = BuildscriptVersionResolver.projectVersion(proje
version = currentVersion

configure(publishable(subprojects)) { subproject ->
apply plugin: 'groovy'
apply plugin: "com.ofg.uptodate"
//Not strictly groovy projects but useful for the IDE to recognise groovy test sources
apply plugin: 'groovy' //gradle groovy plugin extends the java plugin

ext {
jdkVersion = 1.6
Expand Down
4 changes: 4 additions & 0 deletions gradle/coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jacocoTestReport {
def results = parser.parse(report)

def percentage = {
if (null == it) {
//if it does not exist assume 100%
return 100
}
def covered = it.'@covered' as Double
def missed = it.'@missed' as Double
((covered / (covered + missed)) * 100).round(2)
Expand Down
5 changes: 3 additions & 2 deletions gradle/idea.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ idea {
def javacSettings = node.appendNode('component', [name: 'JavacSettings'])
javacSettings.appendNode('option', [name: 'MAXIMUM_HEAP_SIZE', value: "256"])


// license header
def copyrightManager = node.component.find { it.'@name' == 'CopyrightManager' }
copyrightManager.@default = "ASL2"
def aslCopyright = copyrightManager.copyright.find { it.option.find { it.@name == "myName" }?.@value == "ASL2" }
def copyRightFile = file("$rootDir/config/apache-copyright.header")

if (aslCopyright == null) {
copyrightManager.append(new XmlParser().parseText("""
<copyright>
<option name="notice" value="${copyRightFile.text}" />
<option name="notice" value="&#10;&#10;Copyright \${today.year} the original author or authors.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10; http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License.&#10;&#10;" />
<option name="keyword" value="Copyright" />
<option name="allowReplaceKeyword" value="" />
<option name="myName" value="ASL2" />
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ include 'springfox-swagger2'
include 'springfox-swagger-ui'
include 'swagger-contract-tests'
include 'springfox-petstore'
include 'springfox-staticdocs'
3 changes: 0 additions & 3 deletions springfox-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
apply plugin: 'java'
apply plugin: 'groovy'

configurations {
testArtifacts.extendsFrom testRuntime
}
Expand Down
2 changes: 0 additions & 2 deletions springfox-petstore/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
apply plugin: 'groovy'
apply plugin: "com.ofg.uptodate"
ext {
jdkVersion = 1.6
}
Expand Down
4 changes: 0 additions & 4 deletions springfox-schema/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//TODO AK - these can be removed in all projects the top level build file already applies the lang plugins
apply plugin: 'java'
apply plugin: 'groovy'

configurations {
testArtifacts.extendsFrom testRuntime
}
Expand Down
3 changes: 0 additions & 3 deletions springfox-spi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
apply plugin: 'java'
apply plugin: 'groovy'

dependencies {
compile project(':springfox-core')
compile project(':springfox-core')
Expand Down
19 changes: 19 additions & 0 deletions springfox-staticdocs/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

dependencies {
testCompile libs.test
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/

package springfox.staticdocs;

public class Sample {

public String something() {
return "value";
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/

package springfox.staticdocs

import spock.lang.Specification

class SampleTest extends Specification {

def "should pass coverage"() {
expect:
Sample sample = new Sample()
sample.something()
}
}
Empty file.

0 comments on commit b384456

Please sign in to comment.