Skip to content

Commit cff428e

Browse files
authored
Merge pull request #1 from VirgilSecurity/dev
Multi module + Coroutines
2 parents 158deb4 + c9e627d commit cff428e

File tree

53 files changed

+3946
-529
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3946
-529
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@ language: android
22
sudo: required
33
jdk: oraclejdk8
44

5-
# Exclude branches
6-
branches:
7-
except:
8-
- dev
9-
- v0.1
10-
115
# Include branches
126
branches:
137
only:
8+
- dev
149
- master
1510

1611
before_cache:

build.gradle

Lines changed: 82 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
42
ext.versions = [
3+
// Virgil
54
virgilSdk : '5.0.4',
5+
pythia : '0.2.0',
6+
keyknox : '0.1.1',
7+
8+
// Kotlin
69
kotlin : '1.3.0',
7-
coroutines: '0.30.2',
8-
dokka : '0.9.17',
10+
coroutines: '1.0.0-RC1',
11+
12+
// Gradle
13+
gardle : '3.2.1',
14+
15+
// Android
916
android : '4.1.1.4',
17+
18+
// Docs
19+
dokka : '0.9.17',
20+
21+
// Tests
22+
junit : '5.2.0',
1023
]
1124
repositories {
1225
google()
@@ -15,9 +28,9 @@ buildscript {
1528
mavenCentral()
1629
}
1730
dependencies {
18-
classpath 'com.android.tools.build:gradle:3.2.1'
19-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
20-
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
31+
classpath "com.android.tools.build:gradle:$versions.gardle"
32+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
33+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokka"
2134
}
2235
}
2336

@@ -33,3 +46,65 @@ allprojects {
3346
task clean(type: Delete) {
3447
delete rootProject.buildDir
3548
}
49+
50+
enum ArtifactType {
51+
ALL,
52+
STANDARD,
53+
COROUTINES
54+
}
55+
56+
static String getArtifactType(Project project) {
57+
def systemProperty = null
58+
if (System.getenv('ARTIFACT_TYPE') != null)
59+
systemProperty = System.getenv('ARTIFACT_TYPE')
60+
if (System.getProperty('ARTIFACT_TYPE') != null)
61+
systemProperty = System.getProperty('ARTIFACT_TYPE')
62+
63+
if (systemProperty != null)
64+
return systemProperty
65+
else if (project.hasProperty('ARTIFACT_TYPE')) {
66+
return project.findProperty('ARTIFACT_TYPE')
67+
} else {
68+
return "No artifact type is provided. Please, use -DARTIFACT_TYPE property."
69+
}
70+
}
71+
72+
task installEthree() {
73+
def artifactType
74+
try {
75+
artifactType = getArtifactType(project) as ArtifactType
76+
} catch (IllegalArgumentException ignored) {
77+
throw new IllegalArgumentException("Please, choose one of the available types: " + ArtifactType.values() + "."
78+
+ " You entered: " + getArtifactType(project))
79+
}
80+
81+
if (artifactType == ArtifactType.STANDARD) {
82+
dependsOn ':ethree:install'
83+
} else if (artifactType == ArtifactType.COROUTINES) {
84+
dependsOn ':ethreeCoroutines:install'
85+
} else if (artifactType == ArtifactType.ALL) {
86+
dependsOn ':ethree:install', ':ethreeCoroutines:install'
87+
} else {
88+
throw new IllegalArgumentException("Please, choose one of artifacts type: " + ArtifactType.values())
89+
}
90+
}
91+
92+
task publishEthree() {
93+
def artifactType
94+
try {
95+
artifactType = getArtifactType(project) as ArtifactType
96+
} catch (IllegalArgumentException ignored) {
97+
throw new IllegalArgumentException("Please, choose one of the available types: " + ArtifactType.values() + "."
98+
+ " You entered: " + getArtifactType(project))
99+
}
100+
101+
if (artifactType == ArtifactType.STANDARD) {
102+
dependsOn ':ethree:publish'
103+
} else if (artifactType == ArtifactType.COROUTINES) {
104+
dependsOn ':ethreeCoroutines:publish'
105+
} else if (artifactType == ArtifactType.ALL) {
106+
dependsOn ':ethree:publish', ':ethreeCoroutines:publish'
107+
} else {
108+
throw new IllegalArgumentException("Please, choose one of artifacts type: " + ArtifactType.values())
109+
}
110+
}

common/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

common/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
id 'java-library'
3+
}
4+
5+
apply plugin: 'kotlin'
6+
7+
dependencies {
8+
// Kotlin
9+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin"
10+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$versions.coroutines"
11+
}

ethree/src/main/java/com/virgilsecurity/ethree/data/exception/Exceptions.kt renamed to common/src/main/java/com/virgilsecurity/android/common/exceptions/Exceptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
*/
3333

34-
package com.virgilsecurity.ethree.data.exception
34+
package com.virgilsecurity.android.common.exceptions
3535

3636
/**
3737
* Created by:

ethree/build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,27 @@ apply plugin: 'maven'
99
apply plugin: 'org.jetbrains.dokka'
1010

1111
group 'com.virgilsecurity'
12-
version '0.1.0-aplha'
12+
version '0.2.0'
1313

1414
dependencies {
15-
implementation fileTree(dir: 'libs', include: ['*.jar'])
15+
// Inner dependencies
16+
implementation project(':common')
1617

1718
// Virgil
18-
compileOnly "com.virgilsecurity.sdk:crypto:${versions.virgilSdk}"
19-
implementation "com.virgilsecurity.sdk:crypto-android:${versions.virgilSdk}@aar"
19+
compileOnly "com.virgilsecurity.sdk:crypto:$versions.virgilSdk"
20+
implementation "com.virgilsecurity.sdk:crypto-android:$versions.virgilSdk@aar"
2021
implementation "com.virgilsecurity.sdk:sdk:$versions.virgilSdk"
21-
implementation ('com.virgilsecurity:pythia:0.2.0') {
22+
implementation ("com.virgilsecurity:pythia:$versions.pythia") {
2223
exclude group: 'com.virgilsecurity.sdk', module: 'crypto'
2324
}
24-
implementation ('com.virgilsecurity:keyknox:0.1.0') {
25+
implementation ("com.virgilsecurity:keyknox:$versions.keyknox") {
2526
exclude group: 'com.virgilsecurity.sdk', module: 'crypto'
2627
}
2728

29+
// Kotlin
30+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin"
31+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$versions.coroutines"
32+
2833
// Android
2934
compileOnly "com.google.android:android:$versions.android"
3035
}
@@ -53,7 +58,7 @@ publishing {
5358
artifact sourcesJar
5459
artifact javadocJar
5560
pom {
56-
name = 'Virgil E3Kit Kotlin/Java SDK'
61+
name = 'Virgil E3Kit Java/Kotlin SDK'
5762
description = 'Virgil Security provides an SDK which symplifies work with Virgil services and presents easy to use API for adding security to any application. In a few simple steps you can setup user encryption with multidevice support.'
5863
url = 'https://www.virgilsecurity.com/'
5964
licenses {

0 commit comments

Comments
 (0)