Last active
December 2, 2016 10:24
-
-
Save kimukou/752faf885db92d215a8399d36a4e2a0c to your computer and use it in GitHub Desktop.
realmtest build.gradle
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
apply plugin: 'com.android.application' | |
apply plugin: 'realm-android' | |
import com.android.builder.core.DefaultManifestParser | |
android { | |
compileSdkVersion project.compileSdkVersion | |
buildToolsVersion project.buildToolsVersion | |
dataBinding { | |
enabled = true | |
} | |
defaultConfig { | |
/* | |
<uses-sdk | |
android:minSdkVersion="11" | |
android:targetSdkVersion="24" | |
tools:overrideLibrary="android.support.v4,android.support.v14.preference,android.support.customtabs,com.dd.realmbrowser" /> | |
*/ | |
def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile) | |
applicationId = manifestParser.getPackage() | |
versionName = manifestParser.getVersionName() | |
versionCode manifestParser.getVersionCode() | |
minSdkVersion manifestParser.getMinSdkVersion() | |
targetSdkVersion manifestParser.getTargetSdkVersion() | |
jackOptions { | |
enabled false | |
} | |
multiDexEnabled false | |
if(dataBinding.enabled){ | |
multiDexEnabled true | |
multiDexKeepProguard file('multi-dex-keep.txt') | |
} | |
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' | |
} | |
compileOptions { | |
if( defaultConfig.jackOptions.enabled){ | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
else{ | |
sourceCompatibility JavaVersion.VERSION_1_7 | |
targetCompatibility JavaVersion.VERSION_1_7 | |
} | |
} | |
signingConfigs { | |
debug { | |
} | |
release { | |
} | |
} | |
buildTypes { | |
release { | |
debuggable false | |
minifyEnabled true | |
signingConfig signingConfigs.release | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' | |
} | |
debug{ | |
//=== Built-in Shrinker === | |
debuggable true | |
//minifyEnabled true | |
//useProguard false | |
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt','shrinker-rules.pro' | |
//=== Built-in Shrinker === | |
//signingConfig signingConfigs.debug | |
def isIdeBuild = "false"; | |
def compilation = project.properties['android.optional.compilation'] as String | |
if( compilation != null && compilation.indexOf("INSTANT")!=-1){ | |
isIdeBuild = "true" | |
} | |
//isIdeBuild = project.properties['android.injected.invoked.from.ide'] | |
ant.echo "[isIdeBuild]:"+ isIdeBuild | |
if("true" .equalsIgnoreCase(isIdeBuild)){ | |
defaultConfig.minSdkVersion 21 | |
} | |
} | |
} | |
lintOptions { | |
quiet true | |
abortOnError false | |
ignoreWarnings true | |
disable 'LongLogTag' | |
} | |
dexOptions { | |
javaMaxHeapSize "2g" | |
} | |
//Manifest.xmlをマージしない記述 (multiDexEnabledと共用はできません) | |
android.applicationVariants .all{ variant -> | |
variant.outputs.each { output -> | |
//APK作成時の名前を変更する処理 | |
if (variant.buildType.name.equals("release")) { | |
if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) { | |
// Rename APK | |
def applicationId = "testApp" | |
def versionName = defaultConfig.versionName | |
def date = new java.text.SimpleDateFormat("yyyyMMdd_HHmm").format(new Date()) | |
def newName = "${applicationId}_ver.${versionName}_${date}.apk" | |
output.outputFile = new File(output.outputFile.parent, newName) | |
} | |
} | |
} | |
} | |
} | |
dependencies { | |
compile fileTree(include: ['*.jar'], dir: 'libs') | |
compile "com.google.android.gms:play-services-location:$playServicesVersion" | |
compile "com.google.android.gms:play-services-maps:$playServicesVersion" | |
compile "com.google.android.gms:play-services-gcm:$playServicesVersion" | |
compile "com.google.android.gms:play-services-ads:$playServicesVersion" | |
compile 'com.google.maps.android:android-maps-utils:0.4.4' | |
//compile 'com.android.support:support-v4:18.0.0' | |
compile "com.android.support:appcompat-v7:$supportLibraryVersion" | |
compile "com.android.support:support-v4:$supportLibraryVersion" | |
compile "com.android.support:design:$supportLibraryVersion" | |
compile "com.android.support:preference-v7:$supportLibraryVersion" | |
compile "com.android.support:preference-v14:$supportLibraryVersion" | |
compile "com.android.support:customtabs:$supportLibraryVersion" | |
compile "com.android.support:cardview-v7:$supportLibraryVersion" | |
compile "com.android.support:recyclerview-v7:$supportLibraryVersion" | |
if(android.defaultConfig.multiDexEnabled){ | |
ant.echo "[dependencies]multidex:1.0.1" | |
compile 'com.android.support:multidex:1.0.1' | |
} | |
compile 'com.github.bumptech.glide:glide:3.6.1' | |
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar' | |
compile 'com.squareup.okhttp3:okhttp:3.4.2' | |
compile 'com.github.chrisbanes:PhotoView:1.3.0' | |
compile 'com.hannesdorfmann.smoothprogressbar:library:1.0.0@aar' | |
compile 'com.google.code.gson:gson:2.7' | |
compile 'com.google.guava:guava:19.0' | |
compile 'net.vvakame:jsonpullparser-core:1.6.2' // add : jsonPullParserのcoreをdependenciesに指定する | |
annotationProcessor 'net.vvakame:jsonpullparser-apt:1.6.2' // add : ★aptをdependencies指定する | |
compile 'com.j256.ormlite:ormlite-core:4.+' | |
compile 'com.j256.ormlite:ormlite-android:4.+' | |
compile ('com.github.dmytrodanylyk.realm-browser:library:0.0.3'){ | |
exclude module: 'io.realm' | |
} | |
} | |
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:2.3.+' | |
classpath "io.realm:realm-gradle-plugin:2.2.1" | |
} | |
} | |
allprojects { | |
repositories { | |
jcenter() | |
maven { url "https://jitpack.io" } | |
} | |
gradle.projectsEvaluated { | |
tasks.withType(JavaCompile) { | |
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" | |
} | |
} | |
task build_tasks << { | |
tasks.findAll{it.group == "build"}.unique(){it.name}.each{task-> | |
println(task.name) | |
} | |
} | |
tasks.whenTaskAdded { task -> | |
if (task.name.indexOf("assemble")!=-1) { | |
task.group = "build" | |
} | |
} | |
task copyToManifest << { parentF-> | |
new File(parentF).mkdirs() | |
copy{ | |
from file("$projectDir/src/main/AndroidManifest.xml") | |
into file(parentF) | |
} | |
} | |
} | |
project.ext { | |
compileSdkVersion=25 | |
buildToolsVersion="25.0.1" | |
playServicesVersion="10.0.+" | |
supportLibraryVersion="25.+" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//fix
https://github.com/atsushi-ageet/realm-browser
compile ('com.github.atsushi-ageet:realm-browser:0.0.6'){
exclude group: 'io.realm'
}
Realm realm = Realm.getDefaultInstance();
com.dd.realmbrowser.RealmBrowser.getInstance().addRealmConf(realm.getConfiguration());
com.dd.realmbrowser.RealmBrowser.startRealmFilesActivity(activity);