Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #57 from android/fat-jar-resources
Browse files Browse the repository at this point in the history
Fat jar resources
  • Loading branch information
borisf authored Dec 21, 2017
2 parents e04ed31 + ff71d57 commit b215825
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 273 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ Create a real life complexity Android project that mimics your own and observe t

## Build & Run
1. Clone the repo
2. `gradle fatJar`
2. `./gradlew fatJar`
3. `java -jar build/libs/android-studio-poet-all-1.0-SNAPSHOT.jar`

## How
* The generated sources will incude the basic functionality of method calling both in class itself and between the generated classes, both in Java and Kotlin
* The generated sources will include the basic functionality of method calling both in class itself and between the generated classes, both in Java and Kotlin

* The generated build.gradle files will include other modules as dependencies

* You can control Andorid resources (images, layouts etc')
* You can control Android resources (images, layouts etc')

* You can control product flavors

* You can have intermodule depdendencies
* You can have both source and resources inter-module dependencies

This is not an official Google product.

Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ dependencies {
compile 'com.squareup:javapoet:1.9.0'
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:0.19.2"

compile group: 'commons-io', name: 'commons-io', version: '2.0.1'

testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-inline:2.10.0"
testCompile "com.nhaarman:mockito-kotlin:1.5.0"
Expand Down
Binary file removed src/main/assets/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
172 changes: 0 additions & 172 deletions src/main/assets/gradlew

This file was deleted.

84 changes: 0 additions & 84 deletions src/main/assets/gradlew.bat

This file was deleted.

16 changes: 11 additions & 5 deletions src/main/kotlin/com/google/androidstudiopoet/AndroidStudioPoet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@ class AndroidStudioPoet(private val modulesWriter: SourceModuleWriter, private v

val btnGenerate = JButton("Generate").apply {
addActionListener {
val text = textArea.text
println(text)
processInput(configFrom(text)!!)
try {
val text = textArea.text
println(text)
processInput(configFrom(text)!!)

} catch (e: Exception) {
println("ERROR: the generation failed due to JSON script errors - " +
"please fix and try again ")
}
}
}

Expand Down Expand Up @@ -139,7 +145,6 @@ class AndroidStudioPoet(private val modulesWriter: SourceModuleWriter, private v
}
}


private fun createTitleLabel(): JLabel {
return JLabel("Android Studio Poet").apply {
horizontalAlignment = SwingConstants.CENTER
Expand All @@ -163,7 +168,8 @@ class AndroidStudioPoet(private val modulesWriter: SourceModuleWriter, private v
filename == null -> null
!File(filename).canRead() -> null
else -> File(filename).readText().let {
return configFrom(it) }
return configFrom(it)
}
}


Expand Down
Loading

0 comments on commit b215825

Please sign in to comment.