@@ -43,100 +43,83 @@ dependencies {
4343 implementation localGroovy()
4444}
4545
46- tasks. register(" lintRelease" ) {
47- doLast {
48- // Do nothing. We execute the same set of tasks for all our modules in parallel on taskcluster.
49- // This project doesn't have a lint task. To avoid special casing our automation I just added
50- // an empty lint task here.
51- }
52- }
46+ // In app-services, we need all these tasks, which do nothing, so this module behaves like
47+ // our others and we do not need to special case it in automation.
48+ if (! gradle. root. hasProperty(" mozconfig" )) {
49+ tasks. register(" lintRelease" ) {
50+ doLast {}
51+ }
5352
54- tasks. register(" assembleAndroidTest" ) {
55- doLast {
56- // Do nothing. Like the `lint` task above this is just a dummy task so that this module
57- // behaves like our others and we do not need to special case it in automation.
58- }
59- }
53+ tasks. register(" assembleAndroidTest" ) {
54+ doLast {}
55+ }
6056
61- tasks. register(" assembleRelease" ) {
62- doLast {
63- // Do nothing. Like the `lint` task above this is just a dummy task so that this module
64- // behaves like our others and we do not need to special case it in automation.
65- }
66- }
57+ tasks. register(" assembleRelease" ) {
58+ doLast {}
59+ }
6760
68- tasks. register(" testRelease" ) {
69- doLast {
70- // Do nothing. Like the `lint` task above this is just a dummy task so that this module
71- // behaves like our others and we do not need to special case it in automation.
72- }
73- }
61+ tasks. register(" testRelease" ) {
62+ doLast {}
63+ }
7464
75- tasks. register(" checkMavenArtifacts" ) {
76- doLast {
77- // Do nothing. Like the `lint` task above this is just a dummy task so that this module
78- // behaves like our others and we do not need to special case it in automation.
65+ tasks. register(" checkMavenArtifacts" ) {
66+ doLast {}
7967 }
80- }
8168
82- // Must match the implementation in publish.gradle
83- static def getLocalPublicationTimestamp () {
84- def date = new Date ()
85- return date. format(' yyyyMMddHHmmss' )
86- }
69+ // publish only makes sense in app-services.
70+ publishing {
71+ publications {
72+ mavenJava(MavenPublication ) {
73+ from components. java
74+
75+ pom {
76+ groupId = rootProject. config. componentsGroupId
77+ artifactId = archivesBaseName
78+ description = project. ext. description
79+ version = rootProject. config. componentsVersion + (rootProject. hasProperty(' local' ) ? ' -' + rootProject. property(' local' ) : ' ' )
80+
81+ licenses {
82+ license {
83+ name = properties. libLicense
84+ url = properties. libLicenseUrl
85+ }
86+ }
8787
88- publishing {
89- publications {
90- mavenJava(MavenPublication ) {
91- from components. java
92-
93- pom {
94- groupId = rootProject. config. componentsGroupId
95- artifactId = archivesBaseName
96- description = project. ext. description
97- version = rootProject. config. componentsVersion + (rootProject. hasProperty(' local' ) ? ' -' + rootProject. property(' local' ) : ' ' )
98-
99- licenses {
100- license {
101- name = properties. libLicense
102- url = properties. libLicenseUrl
88+ developers {
89+ developer {
90+ name = ' Mozilla Nimbus Team'
91+ email = ' nimbus-team@mozilla.com'
92+ }
10393 }
104- }
10594
106- developers {
107- developer {
108- name = ' Mozilla Nimbus Team '
109- email = ' nimbus-team@mozilla.com '
95+ scm {
96+ connection = properties . libVcsUrl
97+ developerConnection = properties . libVcsUrl
98+ url = properties . libUrl
11099 }
111100 }
101+ }
102+ }
112103
113- scm {
114- connection = properties . libVcsUrl
115- developerConnection = properties . libVcsUrl
116- url = properties . libUrl
104+ if (it . hasProperty( ' android ' )) {
105+ android {
106+ singleVariant( ' release ' ) {
107+ withSourcesJar()
117108 }
118109 }
119110 }
120- }
121111
122- if (it. hasProperty(' android' )) {
123- android {
124- singleVariant(' release' ) {
125- withSourcesJar()
112+ repositories {
113+ maven {
114+ url = " $buildDir /maven"
126115 }
127116 }
128117 }
129118
130- repositories {
131- maven {
132- url = " $b uildDir /maven "
119+ publishing . publications . withType( MavenPublication ) . each { publication ->
120+ def checkFileSizeTask = task " checkLibSizeForMavenArtifact- ${ publication.artifactId } " ( type : Exec ) {
121+ commandLine " ${ rootProject.projectDir } /automation/check_artifact_size.sh " , project . buildDir, publication . artifactId
133122 }
123+ checkMavenArtifacts. dependsOn(checkFileSizeTask)
134124 }
135125}
136-
137- publishing. publications. withType(MavenPublication ). each {publication ->
138- def checkFileSizeTask = task " checkLibSizeForMavenArtifact-${ publication.artifactId} " (type : Exec ) {
139- commandLine " ${ rootProject.projectDir} /automation/check_artifact_size.sh" , project. buildDir, publication. artifactId
140- }
141- checkMavenArtifacts. dependsOn(checkFileSizeTask)
142- }
0 commit comments