-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathbuild.gradle
133 lines (112 loc) · 4.69 KB
/
build.gradle
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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.3.3/userguide/building_java_projects.html
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
//Añado el plugin para eclipse
id 'eclipse'
//para poder publicar paquetes en github
id 'maven-publish'
//Plugin para análisis estático de código
id "nebula.lint" version "17.7.0"
}
version = '0.0'
tasks.withType(JavaCompile) {
//Añadir la opción Xlint
options.deprecation = true
options.encoding = 'ISO-8859-1'
}
tasks.withType(Javadoc){
description = "Genera la documentación"
//indicar que la codificación es ISO
options.encoding = 'ISO-8859-1'
options.charSet = 'ISO-8859-1'
options.author = true
options.version = true
options.use = true
options.memberLevel = JavadocMemberLevel.PROTECTED
options.footer = "MIT-FS: Curso 2021/22"
title = "Audit4Improve-API"
}
task defaultProperties {
println "Project: $project"
println "Name: $name"
println "Path: $path"
println "Project directory: $projectDir"
println "Build directory: $buildDir"
println "Version: $version"
println "Group: $project.group"
println "Description: $project.description"
println "Level: $logging.level"
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
//Añado la dependencia de la librería github que vamos a usar
// https://mvnrepository.com/artifact/org.kohsuke/github-api
//JAVADOC: https://github-api.kohsuke.org/apidocs/index.html
api 'org.kohsuke:github-api:1.301'
//Para la persistencia de informes usaremos la api apachepoi
// https://mvnrepository.com/artifact/org.apache.poi/poi
//JAVADOC: https://poi.apache.org/apidocs/5.0/
implementation 'org.apache.poi:poi:5.2.1'
//Para leer la configuración como ficheros con datos en formato json
// https://mvnrepository.com/artifact/javax.json/javax.json-api
//JAVADOC: https://javadoc.io/doc/org.glassfish/javax.json/latest/overview-summary.html
implementation group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
// https://mvnrepository.com/artifact/org.glassfish/javax.json
//JAVADOC: https://www.javadoc.io/doc/org.glassfish/javax.json/1.1/javax/json/JsonObject.html
implementation 'org.glassfish:javax.json:1.1.4'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:30.1.1-jre'
//Añado para usar mockito
//JAVADOC: https://javadoc.io/doc/org.mockito/mockito-core/4.3.1/overview-summary.html
testImplementation 'org.mockito:mockito-core:4.3.1'
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
//JAVADOC: https://javadoc.io/doc/org.mockito/mockito-junit-jupiter/latest/index.html
testImplementation 'org.mockito:mockito-junit-jupiter:4.3.1'
testImplementation(platform('org.junit:junit-bom:5.8.2'))
//JAVADOC: https://www.javadoc.io/doc/org.junit.jupiter/junit-jupiter-api/latest/index.html
testImplementation('org.junit.jupiter:junit-jupiter')
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
//Para publicar paquetes en github
//group = 'A4I'
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/mit-fs/audit4improve-api")
credentials {
//las propiedades gpr.user y gpr.key están configuradas en gradle.properties en el raiz del proyecto, y se añade a .gitignore para que no se suban
//O bien configuro las variables de entorno GITHUB_LOGIN y GITHUB_PACKAGES
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_LOGIN")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_PACKAGES")
}
}
}
publications {
gpr(MavenPublication) {
//Del tutorial https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven
groupId = 'us.mitfs.samples'
artifactId = 'a4i'
version = '0.0'
from components.java
}
}
}