-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: new way to initialize apt classes.
- Loading branch information
Showing
21 changed files
with
400 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
Sample/app/src/test/java/com/chenenyu/router/app/ExampleUnitTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 0 additions & 145 deletions
145
gradle-plugin/src/main/groovy/com/chenenyu/router/Knife.groovy
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
gradle-plugin/src/main/groovy/com/chenenyu/router/ManifestTransformer.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.chenenyu.router | ||
|
||
//import groovy.xml.XmlParser // Added in gradle7.0(groovy 3.0.0) | ||
import groovy.xml.XmlUtil | ||
import org.gradle.api.Project | ||
|
||
class ManifestTransformer { | ||
static void transform(Project project, File input, File output) { | ||
Node xml = new XmlParser().parse(input) | ||
Node applicationNode = xml.get('application')[0] | ||
applicationNode.appendNode('meta-data', ['android:name': project.name, 'android:value': 'com.chenenyu.router.moduleName']) | ||
def result = XmlUtil.serialize(xml) | ||
output.write(result) | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
gradle-plugin/src/main/groovy/com/chenenyu/router/ManifestTransformerTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.chenenyu.router | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.Project | ||
import org.gradle.api.file.RegularFileProperty | ||
import org.gradle.api.tasks.InputFile | ||
import org.gradle.api.tasks.OutputFile | ||
import org.gradle.api.tasks.TaskAction | ||
|
||
import javax.inject.Inject | ||
|
||
abstract class ManifestTransformerTask extends DefaultTask { | ||
private Project project | ||
|
||
@Inject | ||
ManifestTransformerTask(Project project) { | ||
this.project = project | ||
} | ||
|
||
@InputFile | ||
abstract RegularFileProperty getMergedManifest() | ||
|
||
@OutputFile | ||
abstract RegularFileProperty getUpdatedManifest() | ||
|
||
@TaskAction | ||
void taskAction() { | ||
File input = getMergedManifest().get().asFile | ||
File output = getUpdatedManifest().get().asFile | ||
// project.logger.warn("input: ${input.absolutePath}") | ||
// project.logger.warn("output: ${output.absolutePath}") | ||
|
||
ManifestTransformer.transform(project, input, output) | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
gradle-plugin/src/main/groovy/com/chenenyu/router/Record.groovy
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.