This repository has been archived by the owner on Jul 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathbuild.gradle
63 lines (56 loc) · 2.11 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
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.1"
}
}
import groovyx.net.http.RESTClient
import static groovyx.net.http.ContentType.*
subprojects {
apply plugin: 'io.micronaut.profile'
apply plugin: 'io.micronaut.profile-publish'
group 'io.micronaut.profiles'
version "2.0.0.BUILD-SNAPSHOT"
micronautPublish {
userOrg = "micronaut"
repo = "profiles"
publish = true
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
githubSlug = 'micronaut-projects/micronaut-profiles'
license {
name = 'Apache-2.0'
}
title = "Micronaut ${project.displayName} Profile"
desc = "Micronaut ${project.displayName} Profile"
developers = [jameskleeh:"James Kleeh", zachklein: "Zachary Klein"]
}
task gpgSign() {
description = "Syncs with Maven Central/Sonatype"
doLast {
// println """
// Synchronizing with Maven central. This may take a few minutes ...
// If this fails, log on to http://oss.sonatype.org/ using the centralUser credentials
// and progress through process manually -> Close -> Publish ... under staging repositories
// """
try {
def client = new RESTClient('https://api.bintray.com/')
client.headers['Authorization'] = 'Basic ' + "$bintray.user:$bintray.key".getBytes('iso-8859-1').encodeBase64()
def body = /{}/
def resp = client.post(
path: "gpg/micronaut/profiles/$bintray.pkg.name/versions/$micronautVersion",
body: body,
requestContentType: JSON
)
assert resp.status == 200
} catch (groovyx.net.http.HttpResponseException e) {
println "Error: $e"
println "Message: $e.message"
println "Body: $e.response.data"
throw e
}
}
}
}