File: build.gradle

package info (click to toggle)
simplyhtml 0.17.3+dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,872 kB
  • ctags: 2,205
  • sloc: java: 15,339; xml: 1,087; sh: 101; haskell: 34; makefile: 11
file content (131 lines) | stat: -rw-r--r-- 2,964 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//plugins {
//    id "com.jfrog.bintray" version "1.6"
//}

apply plugin: 'java'
apply plugin: 'eclipse'
//apply plugin: 'maven-publish'
apply plugin: 'maven'

group 'com.lightdev.app.shtm.simplyhtml'
version = '0.17.3'

targetCompatibility='1.7'
sourceCompatibility='1.7'

repositories {
    //jcenter()
    //	maven { url "http://dl.bintray.com/freeplane/freeplane" }
}

dependencies {
	compile 'javax.help:javahelp:2.0.05',
          'org.dpolivaev.mnemonicsetter:mnemonicsetter:0.4'  
}

sourceSets {  
    main {  
        java {  
            srcDir 'src'  
        }  
    }  
    main {  
        resources {  
            srcDir 'src'
			include 'com/lightdev/app/shtm/resources/**'
			include 'com/lightdev/app/shtm/help/**'
        }  
    }  
} 

// holds classes included into SimplyHTMLHelp.jar so they are to be excluded from SimplyHTML.jar
ext.helpExcludes = []

// help.jar
task helpJar(type: Jar) {
    baseName = 'SimplyHTMLHelp'
    from(sourceSets.main.output) {  
        include "com/lightdev/app/shtm/help/**" 
        project.ext.helpExcludes.addAll(includes)
    }  
}

def rename(String jarName) {
    return jarName.replace('javahelp.jar', 'jhall.jar')
}

def removeVersionFrom(String jarName) {
    final int lastMinus = jarName.lastIndexOf('-')
    return jarName.substring(0, lastMinus) + '.jar'
}

// lib.jar
task mainJar(type: Jar, dependsOn: classes) {  
	baseName = 'SimplyHTML'
    from(sourceSets.main.output) {  
        exclude project.ext.helpExcludes
    }
	manifest {
	def classPath = (configurations.compile.collect { rename(removeVersionFrom(it.name)) } +
                   helpJar.outputs.files.collect { removeVersionFrom(it.name) }).join(' ')
    attributes(
		'Implementation-Title': project.name,
        'Implementation-Version': project.version,
        'Main-Class': 'com.lightdev.app.shtm.App',
        'Class-Path': classPath
		)
  }	
}

task sourceJar(type: Jar) {
    baseName = 'SimplyHTML'
    classifier = 'sources'
    from sourceSets.main.allSource
}

/*
publishing {
    publications {
        simplyhtml(MavenPublication) {
            from components.java
            artifactId 'SimplyHTML'
			artifacts = [mainJar]
			artifact sourceJar {
                classifier "sources"
            }
        }
    }
}
*/

task createPom {
    doLast {
        pom {
	        artifactId = 'SimplyHTML'
            project {
                inceptionYear '2011'
                licenses {
                    license {
                        name 'GNU General Public License, Version 2'
                        url 'http://www.gnu.org/licenses/gpl-2.0.html'
                        distribution 'repo'
                    }
                }
            }
        }.writeTo("pom.xml")
    }
}


javadoc {
    enabled = true
    options.encoding = "UTF-8"
    failOnError = false
}

build.dependsOn mainJar
build.dependsOn helpJar
build.dependsOn javadoc
build.dependsOn createPom

apply from: './dist.gradle'