Skip to content

Use library with Android Studio(Gradle)

Kaoru Shoji edited this page Dec 16, 2015 · 6 revisions

Use the library with Android Application project

Add these lines to the project's build.gradle file.

repositories {
    maven {
        url 'https://github.com/kshoji/USB-MIDI-Driver/raw/master/MIDIDriver/snapshots'
        // if you need the latest library, uncomment the line below and comment the line above.
        // url 'https://github.com/kshoji/USB-MIDI-Driver/raw/develop/MIDIDriver/snapshots'
    }
    mavenCentral()
}

dependencies {
    // if you need the latest library, specify `0.1.5-SNAPSHOT` instead of `0.1.4`
    // check the latest release version with https://github.com/kshoji/USB-MIDI-Driver/releases/latest
    compile 'jp.kshoji:midi-driver:0.1.4:@aar'
}

Develop the library

Clone the project

  • Open terminal, and execute git clone https://github.com/kshoji/USB-MIDI-Driver.
  • Wait a moment for downloading. Then, you can see the USB-MIDI-Driver directory.
  • Select Android Studio's Import Project... menu, and choose the USB-MIDI-Driver directory.

Update the snapshot

Execute this on the command line, at USB-MIDI-Driver/MIDIDriver directory.

../gradlew uploadArchives

This will update local file repository, it doesn't send any files.
Then, xml and apklib files are generated in snapshots directory. Commit these and push to the repository.

Execute gradle manually

You can manually execute gradle build from terminal.
Like this:

  • ./gradlew assembleDebug at USB-MIDI-Driver directory
    • This makes building MIDIDriverSample.apk