Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide constants file for gradle dependencies #286

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 26 additions & 27 deletions androidtests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply from: "../constants.gradle"

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion project.ext.compileSdkVersion
buildToolsVersion project.ext.buildToolsVersion

defaultConfig {
minSdkVersion 15
targetSdkVersion 30
versionCode 1
versionName "1.0"
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
versionCode project.ext.versionCode
versionName project.ext.versionName

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments.package = 'me.jahnen.libaums.androidtests'
testInstrumentationRunner project.ext.testInstrumentationRunner
testInstrumentationRunnerArguments.package = "me.jahnen.libaums.androidtests"

consumerProguardFiles "consumer-rules.pro"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
debug {
minifyEnabled false
}
}

useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
useLibrary "android.test.runner"
useLibrary "android.test.base"
useLibrary "android.test.mock"
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'

androidTestImplementation 'androidx.test:core:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation project(':javafs')
androidTestImplementation project(':libusbcommunication')
}
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "androidx.core:core-ktx:$coreKtx"

androidTestImplementation "androidx.test:core:$testCoreVersion"
androidTestImplementation "androidx.test.ext:junit:$testExtJunitVersion"
androidTestImplementation "androidx.test:runner:$testRunnerVersion"
androidTestImplementation "androidx.test:rules:$testRulesVersion"
androidTestImplementation project(":javafs")
androidTestImplementation project(":libusbcommunication")
}
31 changes: 15 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "../constants.gradle"

android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
compileSdkVersion project.ext.compileSdkVersion
buildToolsVersion project.ext.buildToolsVersion

defaultConfig {
applicationId "com.github.mjdev.usbfileman"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
applicationId project.ext.applicationId
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
versionCode project.ext.versionCode
versionName project.ext.versionName
}
buildTypes {
release {
Expand All @@ -26,13 +27,11 @@ android {
}

dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
implementation 'junit:junit:4.12'
api 'androidx.appcompat:appcompat:1.0.0-beta01'
api 'com.google.android.material:material:1.0.0-beta01'
api project(':libaums')
api project(':httpserver')
api project(':storageprovider')
api project(':javafs')
api project(':libusbcommunication')
api "androidx.appcompat:appcompat:$appcompatVersion"
api "com.google.android.material:material:$materialVersion"
api project(":libaums")
api project(":httpserver")
api project(":storageprovider")
api project(":javafs")
api project(":libusbcommunication")
}
64 changes: 15 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.


buildscript {
ext.kotlin_version = '1.3.61'
apply from: "constants.gradle"

repositories {
jcenter()
maven {
url 'https://dl.bintray.com/magnusja/maven'
}
maven {
url 'https://maven.google.com/'
name 'Google'
url "https://dl.bintray.com/magnusja/maven"
}
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'

classpath 'org.codehaus.groovy:groovy-all:2.4.15'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.20"
classpath "com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0"

dependencies {
classpath "com.android.tools.build:gradle:$buildGradleVersion"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradleBintrayPluginVersion"
classpath "com.github.dcendents:android-maven-gradle-plugin:$androidMavenGradlePluginVersion"
classpath "org.codehaus.groovy:groovy-all:$groovyAllVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaGradlePluginVersion"
classpath "com.vanniktech:gradle-android-junit-jacoco-plugin:$jacocoPluginVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

ext {
bintrayRepo = 'maven'

publishedGroupId = 'me.jahnen'
libraryName = 'libaums'

// artifact comes from module as well as libraryVersion
//artifact = 'libaums'

libraryDescription = 'Android USB mass storage library with FAT32 support.'

siteUrl = 'https://github.com/magnusja/libaums'
gitUrl = 'https://github.com/magnusja/libaums.git'


developerId = 'magnusja'
developerName = 'Magnus Jahnen'
developerEmail = 'github@mgns.tech'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

allprojects {
repositories {
jcenter()
maven { url 'https://dl.bintray.com/magnusja/maven' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url "https://dl.bintray.com/magnusja/maven" }
mavenCentral()
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

92 changes: 92 additions & 0 deletions constants.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/**
* Project dependencies constants.
*/
project.ext {

/////////////////////////////////////
// Version section
/////////////////////////////////////

applicationId = "com.github.mjdev.usbfileman"

versionCode = 2
versionName = "0.2"

versionCodeProduction = 80
versionNameProduction = "0.8.0"

/////////////////////////////////////
// SDK section
/////////////////////////////////////

compileSdkVersion = 30
minSdkVersion = 16
targetSdkVersion = 30
ndkVersion = "22.0.7026061"

/////////////////////////////////////
// Build section
/////////////////////////////////////

buildToolsVersion = "30.0.3"
buildGradleVersion = "4.1.2"
gradleBintrayPluginVersion = "1.8.4"
androidMavenGradlePluginVersion = "2.1"
groovyAllVersion = "2.4.15"
dokkaGradlePluginVersion = "1.4.20"
jacocoPluginVersion = "0.16.0"
appcompatVersion = "1.2.0"
materialVersion = "1.3.0"

nanohttpdVersion = "2.3.1"
koushikduttaAsyncVersion = "2.+"
annotationVersion = "1.1.0"

log4jVersion = "1.2.17"
loggingLog4jVersion = "1.0.3"
javaFsVersion = "0.1.5"

/////////////////////////////////////
// Kotlin section
/////////////////////////////////////

kotlinVersion = "1.4.30"
coreKtx = "1.3.2"

/////////////////////////////////////
// Test section
/////////////////////////////////////

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
junitVersion ="4.13.1"
apacheCommonsIoVersion = "1.3.2"
eclipsesourceMinimalJsonVersion = "0.9.4"
xeneiJunitContractsVersion = "0.1.7"
mockitoCoreVersion = "3.6.0"
testCoreVersion = "1.3.0"
testExtJunitVersion = "1.1.2"
testRunnerVersion = "1.3.0"
testRulesVersion = "1.3.0"

/////////////////////////////////////
// Library section
/////////////////////////////////////

bintrayRepo = "maven"

publishedGroupId = "me.jahnen"
libraryName = "libaums"

libraryDescription = "Android USB mass storage library with FAT32 support."

siteUrl = "https://github.com/magnusja/libaums"
gitUrl = "https://github.com/magnusja/libaums.git"

developerId = "magnusja"
developerName = "Magnus Jahnen"
developerEmail = "github@mgns.tech"

licenseName = "The Apache Software License, Version 2.0"
licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
allLicenses = ["Apache-2.0"]
}
56 changes: 24 additions & 32 deletions httpserver/build.gradle
Original file line number Diff line number Diff line change
@@ -1,60 +1,52 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'org.jetbrains.dokka'
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "org.jetbrains.dokka"
apply from: "../constants.gradle"

project.archivesBaseName = 'libaums-httpserver'
project.archivesBaseName = "libaums-httpserver"

ext {
artifact = 'libaums-httpserver'
bintrayName = 'libaums-httpserver'
libraryVersion = '0.5.3'
artifact = "libaums-httpserver"
bintrayName = "libaums-httpserver"
libraryVersion = "0.5.3"
}

configurations {
javadocDeps
}

android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
compileSdkVersion project.ext.compileSdkVersion
buildToolsVersion project.ext.buildToolsVersion

defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
versionCode project.ext.versionCode
versionName project.ext.versionName
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
lintOptions {
abortOnError false
}
}


dependencies {
api 'org.nanohttpd:nanohttpd:2.+'
javadocDeps 'org.nanohttpd:nanohttpd:2.+'

api 'com.koushikdutta.async:androidasync:2.+'

api fileTree(include: ['*.jar'], dir: 'libs')
api 'androidx.annotation:annotation:1.1.0'
api 'androidx.core:core:1.2.0-rc01'
api project(':libaums')
api "androidx.core:core-ktx:1.1.0"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
javadocDeps "org.nanohttpd:nanohttpd:$nanohttpdVersion"
api "org.nanohttpd:nanohttpd:$nanohttpdVersion"
api "com.koushikdutta.async:androidasync:$koushikduttaAsyncVersion"
api "androidx.core:core-ktx:$coreKtx"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
api project(":libaums")
}

task bintray {
apply from: '../install.gradle'
apply from: '../bintray.gradle'
apply from: "../install.gradle"
apply from: "../bintray.gradle"
}
repositories {
mavenCentral()
}