@@ -38,24 +38,17 @@ public class GenerateRepoImpl implements Plugin<Project> {
3838 project. uploadArchives {
3939 repositories {
4040 mavenDeployer {
41- println (" wang mavenDeployer" )
4241 // 设置插件的GAV参数
4342 pom. groupId = groupId
44- println (" wang mavenDeployer wrong1" )
4543 pom. artifactId = artifactId
46- println (" wang mavenDeployer wrong2" )
4744 pom. version = sdkVersion
4845 // 文件发布到下面目录
49- println (" wang mavenDeployer wrong3" )
5046 repository(url : repoUri)
51- println (" wang mavenDeployer wrong4" )
5247 pom. withXml {
53- println (" wang withXml ${ asNode()} " )
5448 getAllLocalDependency(project)
5549
5650
5751 Node dependenciesNode = asNode(). getAt(" dependencies" )[0 ]
58- println (" wang withXml dependenciesNode ${ dependenciesNode} " )
5952 if (dependenciesNode != null ) {
6053 dependenciesNode. replaceNode {}
6154 } else {
@@ -74,13 +67,9 @@ public class GenerateRepoImpl implements Plugin<Project> {
7467 def allDependencies = project. configurations[configurationName]. allDependencies
7568 allDependencies. each {
7669
77- println (" wang ${ it.group} ${ it.name} " )
78-
7970 def islocal = false
8071 localArtifacts. each { local ->
81- println (" islocal? ${ it.group} :${ it.name} :${ it.version} ${ local.moduleVersion} " )
8272 if (" ${ it.group} :${ it.name} :${ it.version} " == local. moduleVersion. toString()) {
83- println (" islocal? true" )
8473 islocal = true
8574 }
8675 }
@@ -106,7 +95,6 @@ public class GenerateRepoImpl implements Plugin<Project> {
10695 }
10796 }
10897
109- println (" wang withXml dependenciesNode 123 ${ dependenciesNode} " )
11098 repoArtifacts. each { repoArtifact ->
11199 boolean isAdded = false
112100 pomDependency. each {
@@ -115,7 +103,6 @@ public class GenerateRepoImpl implements Plugin<Project> {
115103 }
116104 }
117105 if (! isAdded) {
118- println (" wang add ${ repoArtifact.moduleVersion} " )
119106 def dependencyNode = dependenciesNode. appendNode(' dependency' )
120107 dependencyNode. appendNode(' groupId' , repoArtifact. moduleVersion. id. group)
121108 dependencyNode. appendNode(' artifactId' , repoArtifact. moduleVersion. id. name)
@@ -124,21 +111,12 @@ public class GenerateRepoImpl implements Plugin<Project> {
124111
125112 }
126113 asNode(). appendNode(dependenciesNode)
127- println (" wang withXml dependenciesNode 123456 ${ dependenciesNode} " )
128- println (" wang pom finish ${ asNode()} " )
129114 }
130115 }
131116 }
132117 project. uploadArchives. doLast {
133118 copyDependencyFile(project)
134119 }
135-
136-
137- Upload uploadArchives = (Upload ) project. getTasks(). withType(Upload . class). findByName(" uploadArchives" )
138-
139- if (uploadArchives != null ) {
140- println (" wang get uploadArchives suc" )
141- }
142120 }
143121 }
144122
@@ -148,7 +126,6 @@ public class GenerateRepoImpl implements Plugin<Project> {
148126 if (allDependencies != null && ! allDependencies. isEmpty()) {
149127 allDependencies. reverseEach {
150128 artifact ->
151- println (" getAllDependency, artifact:$artifact ${ artifact.name} " )
152129 if (isLocal(artifact) && ! localArtifacts. contains(artifact)) {
153130 localArtifacts. add(artifact)
154131 }
@@ -160,13 +137,11 @@ public class GenerateRepoImpl implements Plugin<Project> {
160137 }
161138
162139 private void copyDependencyFile (Project project ) {
163- println (" wang copyDependencyFile,${ localArtifacts} " )
164140 def libsPath = " $repo /${ groupId.replace(".", "/")} /${ artifactId} /${ sdkVersion} /libs"
165141
166142// delete "${libsPath}"
167143 localArtifacts. forEach {
168144 artifact ->
169- println (" localArtifacts $artifact ${ artifact.file} " )
170145 def artifactPath = artifact. file
171146 if (artifact. type == ' aar' ) {
172147 project. copy {
@@ -205,9 +180,6 @@ public class GenerateRepoImpl implements Plugin<Project> {
205180 }
206181 repoUri = project. uri(repo)
207182
208-
209-
210-
211183 initUpload(project)
212184 }
213185}
0 commit comments