-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Configure tasks lazily This fixes an issue where applying OkReplay plugin would cause all tasks in the project to be configured eagerly. * Replace plugins.withId with plugins.withType * Make a comment clearer
- Loading branch information
1 parent
02271d1
commit 42d4d6a
Showing
11 changed files
with
172 additions
and
130 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
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
8 changes: 4 additions & 4 deletions
8
okreplay-gradle-plugin/src/main/kotlin/okreplay/DeviceBridgeProvider.kt
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
package okreplay | ||
|
||
import com.android.annotations.VisibleForTesting | ||
import org.gradle.api.Project | ||
import org.gradle.api.logging.Logger | ||
import java.io.File | ||
|
||
internal class DeviceBridgeProvider { | ||
companion object { | ||
private var instance: DeviceBridge? = null | ||
|
||
internal fun get(adbPath: File, adbTimeoutMs: Int, project: Project): DeviceBridge = | ||
internal fun get(adbPath: File, adbTimeoutMs: Int, logger: Logger): DeviceBridge = | ||
if (instance != null) { | ||
instance as DeviceBridge | ||
} else { | ||
DeviceBridge(adbPath, adbTimeoutMs, project.logger) | ||
DeviceBridge(adbPath, adbTimeoutMs, logger) | ||
} | ||
|
||
@VisibleForTesting internal fun setInstance(deviceBridge: DeviceBridge) { | ||
instance = deviceBridge | ||
} | ||
} | ||
} | ||
} |
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
31 changes: 15 additions & 16 deletions
31
okreplay-gradle-plugin/src/main/kotlin/okreplay/PullTapesTask.kt
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
10 changes: 7 additions & 3 deletions
10
okreplay-gradle-plugin/src/main/kotlin/okreplay/TapeTask.kt
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package okreplay | ||
|
||
import org.gradle.api.Task | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.Internal | ||
import java.io.File | ||
|
||
interface TapeTask : Task { | ||
@get:Input var packageName: String? | ||
@get:Input var deviceBridge: DeviceBridge? | ||
} | ||
@get:Input val packageName: Property<String> | ||
@get:Internal val adbPath: Property<File> | ||
@get:Internal val adbTimeout: Property<Int> | ||
} |
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
Oops, something went wrong.