Giter Site home page Giter Site logo

deckard-kotlin's Introduction

Deckard

Build Status

Deckard is the simplest possible Kotlin Android application project that uses Robolectric for testing and Gradle to build. It has one Activity and a single Robolectric test of that Activity.

Deckard imports easily into the latest editions of Android Studio with minimal setup.

Setup

Note: These instructions assume you have a Java 1.8 JDK installed.

To start a new Android project:

  1. Install Android Studio 3.0.

  2. Download Deckard-Kotlin as a zip here and then extract it on your dev machine.

  3. Import the template into Android Studio by clicking "Import project" and selecting the project directory.

  4. Change the names of things from 'Deckard' to whatever is appropriate for your project. Package name, classes, build.gradle, and the AndroidManifest are good places to start.

  5. Build an app. Win.

Running on the command line

  1. In the project directory you should be able to run the Robolectric tests:

    ./gradlew test
  2. You can also run the Espresso tests:

    ./gradlew connectedAndroidTest

    Note: Make sure to start an Emulator or connect a device first so the test has something to connect to.

  3. Finally you can build a debug .apk of the project for installation on phones:

    ./gradlew assemble

    This will output the file to build/outputs/apk/*-debug.apk

deckard-kotlin's People

Contributors

mooingcat avatar seadowg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

deckard-kotlin's Issues

doesnt work in AndroidStudio 3 with 3.0.0-alpha1 android gradle plugin

If you upgrade the gradle android plugin to 3.0.0-alpha1

buildscript {
    ext.kotlin_version = '1.1.2-4'

    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

then running the test within IntelliJ will lead to

Class not found: "com.example.test.DeckardActivityTest"Empty test suite.

It's been long time no upgrade.

Hi Mr Stott,

Your repo is very smart and pretty for demonstrate mockito with kotlin. But it's been long time no upgrade.
Since Robolectric has already released 4.2 version. Google is porting android.test to AndroidX library, which has a new AndroidJUnitRunner.
For example: constants = BuildConfig::class has been removed from the latest Robolectric.
Do you have plan to update this repo?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.