Skip to content

Commit e15a324

Browse files
author
Yurj Shmakov
committed
[fixbug] fix build fix
1 parent 6d077fb commit e15a324

File tree

12 files changed

+402
-394
lines changed

12 files changed

+402
-394
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ Android Studio modile config file
3535
captures/
3636
.idea/
3737

38+
# Moxy artifacts
3839
VERSION
40+
artifacts/
41+
artifacts-maven/

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ buildscript {
77
google()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.0.0'
11-
classpath 'me.tatarka:gradle-retrolambda:3.2.4'
10+
classpath 'com.android.tools.build:gradle:3.1.2'
1211
}
1312
}
1413

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Sep 20 12:23:05 MSK 2017
1+
#Tue Jun 05 00:53:30 NOVT 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

gradlew

100644100755
File mode changed.

moxy-android/build.gradle

Lines changed: 81 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
4646
}
4747

4848
task makeJar(type: Jar, dependsOn: classes) {
49-
from('build/classes/main')
49+
from('build/classes/java/main')
5050
}
5151

52-
task copyVersion << {
52+
task copyVersion {
53+
doLast {
54+
def versionFile = new File(project.rootDir, versionFile)
55+
versionFile.write(targetVersionName)
5356

54-
def versionFile = new File(project.rootDir, versionFile)
55-
versionFile.write(targetVersionName)
56-
57-
[publishDir, publishMavenDir].each { dest ->
58-
copy {
59-
from versionFile
60-
into dest
57+
[publishDir, publishMavenDir].each { dest ->
58+
copy {
59+
from versionFile
60+
into dest
61+
}
6162
}
6263
}
6364
}
@@ -122,105 +123,106 @@ def getBasePom(String libName) {
122123

123124
}
124125

125-
task copyJars << {
126-
127-
def buildDir = 'build/libs/'
128-
copy {
129-
from buildDir
130-
into publishMavenDir
131-
}
126+
task copyJars {
127+
doLast {
128+
def buildDir = 'build/libs/'
129+
copy {
130+
from buildDir
131+
into publishMavenDir
132+
}
132133

133-
copy {
134-
from(buildDir)
135-
{
136-
rename targetArtefactId + '(.*)', targetArtefactIdDev + '$1'
137-
}
138-
into publishDir
134+
copy {
135+
from(buildDir)
136+
{
137+
rename targetArtefactId + '(.*)', targetArtefactIdDev + '$1'
138+
}
139+
into publishDir
140+
}
139141
}
140142
}
141143

142144

143145

144146

145-
task createPomXml << {
146-
147-
// creating local pom
147+
task createPomXml {
148+
doLast {
149+
// creating local pom
148150

149-
getBasePom('moxy-dev').withXml {
150-
asNode().appendNode('build').appendNode('plugins').with {
151-
appendNode('plugin').with {
152-
appendNode('groupId', 'org.apache.maven.plugins')
153-
appendNode('artifactId', 'maven-gpg-plugin')
154-
appendNode('version', '1.5')
155-
appendNode('executions').with {
156-
appendNode('execution').with {
157-
appendNode('id', 'sign-artifacts')
158-
appendNode('phase', 'verify')
159-
appendNode('goals').with {
160-
appendNode('goal', 'sign')
151+
getBasePom('moxy-dev').withXml {
152+
asNode().appendNode('build').appendNode('plugins').with {
153+
appendNode('plugin').with {
154+
appendNode('groupId', 'org.apache.maven.plugins')
155+
appendNode('artifactId', 'maven-gpg-plugin')
156+
appendNode('version', '1.5')
157+
appendNode('executions').with {
158+
appendNode('execution').with {
159+
appendNode('id', 'sign-artifacts')
160+
appendNode('phase', 'verify')
161+
appendNode('goals').with {
162+
appendNode('goal', 'sign')
163+
}
161164
}
162165
}
166+
appendNode('configuration').appendNode('gpgArguments').appendNode('arg', '--no-tty')
163167
}
164-
appendNode('configuration').appendNode('gpgArguments').appendNode('arg', '--no-tty')
165168
}
166-
}
167169

168-
asNode().artifactId*.value = targetArtefactIdDev
170+
asNode().artifactId*.value = targetArtefactIdDev
169171

170-
asNode().dependencies.'*'.findAll() {
171-
it.version.text() == '4.0.+' && project.configurations.compile.allDependencies.find { dep ->
172-
dep.name == it.artifactId.text()
172+
asNode().dependencies.'*'.findAll() {
173+
it.version.text() == '4.0.+' && project.configurations.compile.allDependencies.find { dep ->
174+
dep.name == it.artifactId.text()
175+
}
176+
}.each() {
177+
it.version*.value = '[4.0,)'
173178
}
174-
}.each() {
175-
it.version*.value = '[4.0,)'
176-
}
177179

178180

179-
}.writeTo(publishDir + "/" + targetArtefactIdDev + ".pom")
181+
}.writeTo(publishDir + "/" + targetArtefactIdDev + ".pom")
180182

181-
//creating global pom
183+
//creating global pom
182184

183-
getBasePom('moxy').withXml {
185+
getBasePom('moxy').withXml {
184186

185-
asNode().appendNode('build')
186-
.appendNode('plugins')
187+
asNode().appendNode('build')
188+
.appendNode('plugins')
187189

188190

189-
}.writeTo(publishMavenDir + "/" + targetArtefactId + ".pom")
191+
}.writeTo(publishMavenDir + "/" + targetArtefactId + ".pom")
190192

191-
getBasePom('moxy').withXml {
193+
getBasePom('moxy').withXml {
192194

193-
asNode().appendNode('build')
194-
.appendNode('plugins')
195-
.appendNode('plugin')
196-
.with {
197-
appendNode('groupId', 'org.sonatype.plugins')
198-
appendNode('artifactId', 'nexus-staging-maven-plugin')
199-
appendNode('version', '1.6.4')
200-
appendNode('extensions', 'true')
201-
appendNode('configuration').with {
202-
appendNode('serverId', 'ossrh')
203-
appendNode('nexusUrl', 'https://oss.sonatype.org/')
204-
appendNode('autoReleaseAfterClose', 'false')
205-
}
206-
}
207-
208-
asNode().appendNode('distributionManagement').with {
209-
appendNode('snapshotRepository')
210-
.with {
211-
appendNode('id', 'ossrh')
212-
appendNode('url', 'https://oss.sonatype.org/content/repositories/snapshots')
213-
}
214-
appendNode('repository')
195+
asNode().appendNode('build')
196+
.appendNode('plugins')
197+
.appendNode('plugin')
215198
.with {
216-
appendNode('id', 'ossrh')
217-
appendNode('url', 'https://oss.sonatype.org/service/local/staging/deploy/maven2/')
199+
appendNode('groupId', 'org.sonatype.plugins')
200+
appendNode('artifactId', 'nexus-staging-maven-plugin')
201+
appendNode('version', '1.6.4')
202+
appendNode('extensions', 'true')
203+
appendNode('configuration').with {
204+
appendNode('serverId', 'ossrh')
205+
appendNode('nexusUrl', 'https://oss.sonatype.org/')
206+
appendNode('autoReleaseAfterClose', 'false')
207+
}
218208
}
219-
}
220209

221-
}.writeTo(publishMavenDir + "/pom.xml")
210+
asNode().appendNode('distributionManagement').with {
211+
appendNode('snapshotRepository')
212+
.with {
213+
appendNode('id', 'ossrh')
214+
appendNode('url', 'https://oss.sonatype.org/content/repositories/snapshots')
215+
}
216+
appendNode('repository')
217+
.with {
218+
appendNode('id', 'ossrh')
219+
appendNode('url', 'https://oss.sonatype.org/service/local/staging/deploy/maven2/')
220+
}
221+
}
222222

223+
}.writeTo(publishMavenDir + "/pom.xml")
223224

225+
}
224226
}
225227

226228
compileJava.dependsOn clearPublishDir

0 commit comments

Comments
 (0)