This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
186 lines (159 loc) · 5.78 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
buildscript {
ext.kotlin_version = '1.4.10'
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'http://dl.bintray.com/jetbrains/intellij-plugin-service'
}
maven {
url "https://dl.bintray.com/ferranpons/maven"
}
maven {
url "https://dl.bintray.com/schibstedspain/maven"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.ferranpons:twitter-gradle-plugin:1.1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.6.2"
classpath 'com.novoda:bintray-release:0.8.1'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.14"
}
}
plugins {
id "org.jetbrains.intellij" version "0.4.10"
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC7-3"
id 'org.jetbrains.kotlin.jvm' version '1.2.51'
id "org.jlleitschuh.gradle.ktlint" version "9.2.1"
}
apply plugin: 'idea'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'twitter-gradle-plugin'
apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: 'com.novoda.bintray-release'
ext.versionProps = new Properties()
versionProps.load(new FileInputStream(rootDir.absolutePath + "/version.properties"))
def versionMajor = Integer.parseInt(versionProps['MAJOR'] as String)
def versionMinor = Integer.parseInt(versionProps['MINOR'] as String)
def versionPatch = Integer.parseInt(versionProps['PATCH'] as String)
def isArtifactoryDeploy = "true" == System.getenv("ARTIFACTORY_DEPLOY")
static def getDate() {
return new Date().format('yyyyMMddHH')
}
def buildVersion
if (isArtifactoryDeploy) {
buildVersion = "${versionMajor}.${versionMinor}.${versionPatch}-${getDate()}-SNAPSHOT"
} else {
buildVersion = "${versionMajor}.${versionMinor}.${versionPatch}"
}
sourceCompatibility = 1.8
group 'com.schibsted.protein'
version buildVersion
def intelliJVersion = '202.7319.50'
def sinceVersion = '172.0'
intellij {
version intelliJVersion
plugins = ['java', 'coverage']
pluginName 'Protein - Kotlin code generator for Retrofit2 and RxJava2 based on Swagger'
}
publish {
userOrg = 'schibstedspain'
groupId = 'com.schibsted.spain.protein'
artifactId = 'protein'
publishVersion = "${buildVersion}"
desc = 'Protein is a plugin for intelliJ that automates the build of "Agents" for Android in Kotlin. It generates the code for Retrofit based on a Swagger endpoint.'
website = 'https://github.com/AdevintaSpain/protein'
}
publishPlugin {
token project.hasProperty('intellijPublishToken') ? project.intellijPublishToken : System.getenv()['intellijPublishToken']
channels 'stable'
}
patchPluginXml {
version buildVersion
sinceBuild sinceVersion
untilBuild intelliJVersion
pluginDescription new File('media/plugin_description.html').text
changeNotes new File('CHANGELOG.md').text
}
twitterPlugin {
consumerKey = System.getenv()['TWITTER_API_KEY']
consumerSecret = System.getenv()['TWITTER_API_SECRET']
accessToken = System.getenv()['TWITTER_ACCESS_TOKEN']
accessTokenSecret = System.getenv()['TWITTER_ACCESS_TOKEN_SECRET']
message = "New Protein version ${versionMajor}.${versionMinor}.${versionPatch} pushed to the IntelliJ Plugin repository. Protein is a Kotlin code generator for Retrofit 2 and RxJava 3 based on Swagger #kotlin #intelliJ #plugin https://plugins.jetbrains.com/plugin/10206-protein--android-component-builder"
}
tasks.withType(Javadoc).all {
enabled = false
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/schibstedspain/maven"
}
}
detekt {
version = "1.0.0.RC7-3"
profile("main") {
input = "$projectDir/src/main/kotlin"
config = "$projectDir/config/detekt/detekt-config.yml"
output = "$projectDir/build/reports/detekt/detekt.xml"
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
}
}
ktlint {
reporters {
reporter "plain"
reporter "checkstyle"
}
}
dependencies {
implementation "io.reactivex.rxjava3:rxjava:3.0.4"
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation ("com.schibsted.spain:retroswagger:1.1.0") {
exclude group: 'org.slf4j'
}
def jacksonVersion = '2.8.4'
implementation "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
implementation 'com.google.code.gson:gson:2.8.0'
def swaggerVersion = '1.5.16'
implementation "io.swagger:swagger-annotations:$swaggerVersion"
implementation("io.swagger:swagger-core:$swaggerVersion") {
exclude group: 'org.slf4j'
}
implementation("io.swagger:swagger-models:$swaggerVersion") {
exclude group: 'org.slf4j'
}
implementation("io.swagger:swagger-parser:1.0.33") {
exclude group: 'org.slf4j'
}
implementation 'commons-io:commons-io:2.5'
implementation("com.bugsnag:bugsnag:3.+") {
exclude group: 'org.slf4j'
}
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.1.3-2'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'junit:junit:4.12'
testImplementation "com.schibsted.spain:retroswagger:1.1.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}