aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
blob: d408dcf6edbc92306b0763455113d64c4aef036c (plain)
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
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

plugins {
  id 'groovy'
  id 'java-gradle-plugin'
  id 'maven-publish'
  id 'signing'
  id 'com.gradleup.nmcp' version '0.1.4'
}

group = 'org.qtproject.qt.gradleplugin'
// keep version in sync with doc/config/qtgradleplugin-project.qdocconf
version = '1.3'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation libs.spock.core
    testImplementation 'org.junit.jupiter:junit-jupiter'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

gradlePlugin {
    plugins {
        qtplugin {
            id = group
            implementationClass = 'org.qtproject.qt.gradleplugin.QtGradlePlugin'
        }
    }
}

tasks.named('test', Test) {
    useJUnitPlatform()
    testLogging {
        showStandardStreams = true
        events = ["passed", "failed", "skipped"]
    }
}

tasks.named('jar', Jar) {
    manifest {
        attributes(
            "Implementation-Version": version,
            "Implementation-Title": "Qt Gradle Plugin",
            "Implementation-Vendor": "Qt Group"
        )
    }
}

afterEvaluate {
    publishing {
        publications {
            it.withType(MavenPublication).configureEach {
                groupId = it.groupId
                artifactId = it.artifactId
                version = it.version
                pom {
                    name = 'Qt Gradle Plugin'
                    description = 'A plugin for building, dependency linking and packaging of Qt for Android sub-projects'
                    url = 'https://code.qt.io/cgit/qt-labs/qtgradleplugin.git'
                    licenses {
                        license {
                            name = 'Apache-2.0'
                            url = 'http://www.apache.org/licenses/LICENSE-2.0'
                        }
                        license {
                            name = 'GPL-3.0-only'
                            url = 'https://www.gnu.org/licenses/'
                        }
                        license {
                            name = 'LicenseRef-Qt-Commercial'
                            url = 'https://www.qt.io/terms-conditions'
                        }
                    }
                    developers {
                        developer {
                            organization = 'Qt Group'
                            url = 'https://www.qt.io'
                            email = 'qt.android@qt.io'
                        }
                    }
                    scm {
                        connection = 'scm:git:git://code.qt.io/qt-labs/qtgradleplugin.git'
                        developerConnection = 'scm:git:https://codereview.qt-project.org/qt-labs/qtgradleplugin'
                        url = 'https://code.qt.io/cgit/qt-labs/qtgradleplugin.git'
                    }
                }
            }
        }
        repositories {
            maven {
                url = project.publishingUrl
                credentials {
                    username = project.publishingUser
                    password = project.publishingPass
                }
            }
        }
    }
}

java {
    withSourcesJar()
    withJavadocJar()
}

signing {
    required = gradle.taskGraph.hasTask("publish")
    sign publishing.publications
}

nmcp {
    centralPortal {
        username = project.publishingUser
        password = project.publishingPass
        // USER_MANAGED publish manually from the portal (recommended)
        // AUTOMATIC publish automatically (alternative)
        publishingType = "USER_MANAGED"
    }
}