Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Commit e9fbb8b

Browse files
authored
Merge pull request #90 from 05nelsonm/2.0.0
2.0.0
2 parents 40e0292 + b65d263 commit e9fbb8b

860 files changed

Lines changed: 7352 additions & 4415 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,21 @@ The following exception is an additional permission under section 7 of the
3636
GNU General Public License, version 3 (“GPLv3”).
3737

3838
"The Interfaces" is henceforth defined as Application Programming Interfaces
39-
that are publicly available classes/functions/etc (ie: do not contain the
40-
visibility modifiers `internal`, `private`, `protected`, or are within
41-
classes/functions/etc that contain the aforementioned visibility modifiers)
42-
to TorOnionProxyLibrary-Android users that are needed to implement
43-
TorOnionProxyLibrary-Android and reside in ONLY the following modules:
39+
needed to implement TorOnionProxyLibrary-Android, as listed below:
4440

45-
- topl-core-base
46-
- topl-service
41+
- From the `topl-core-base` module:
42+
- All Classes/methods/variables
4743

48-
The following are excluded from "The Interfaces":
44+
- From the `topl-service-base` module:
45+
- All Classes/methods/variables
46+
47+
- From the `topl-service` module:
48+
- The TorServiceController class and it's contained classes/methods/variables
49+
- The ServiceNotification.Builder class and it's contained classes/methods/variables
50+
- The BackgroundManager.Builder class and it's contained classes/methods/variables
51+
- The BackgroundManager.Companion class and it's contained methods/variables
52+
53+
The following code is excluded from "The Interfaces":
4954

5055
- All other code
5156

build.gradle

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
apply plugin: 'org.jetbrains.dokka'
2-
31
buildscript {
42
apply from: "$rootDir/gradle/dependencies.gradle"
53

@@ -9,24 +7,73 @@ buildscript {
97
mavenCentral()
108
}
119
dependencies {
12-
classpath deps.androidGradlePlugin
13-
classpath deps.kotlin.dokka
14-
classpath deps.kotlin.gradlePlugin
15-
classpath deps.mavenPublish
10+
classpath plugin.androidGradle
11+
classpath plugin.kotlin.dokka
12+
classpath plugin.kotlin.gradle
13+
classpath plugin.mavenPublish
14+
classpath plugin.gradleVersions
1615
}
1716
}
1817

1918
allprojects {
2019
repositories {
2120
google()
2221
jcenter()
22+
// maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
2323
}
2424

2525
tasks.withType(Test) {
2626
maxHeapSize = "4096m"
2727
}
2828
}
2929

30+
task clean(type: Delete) {
31+
delete rootProject.buildDir
32+
}
33+
34+
////////////////////////////////////////////////////////////////////////////
35+
/// Gradle Versions: https://github.com/ben-manes/gradle-versions-plugin ///
36+
////////////////////////////////////////////////////////////////////////////
37+
38+
apply plugin: 'com.github.ben-manes.versions'
39+
40+
def isNonStable = { String version ->
41+
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
42+
def regex = /^[0-9,.v-]+(-r)?$/
43+
return !stableKeyword && !(version ==~ regex)
44+
}
45+
46+
tasks.named("dependencyUpdates").configure {
47+
checkForGradleUpdate = true
48+
49+
// Example 1: reject all non stable versions
50+
rejectVersionIf {
51+
isNonStable(candidate.version)
52+
}
53+
54+
// Example 2: disallow release candidates as upgradable versions from stable versions
55+
rejectVersionIf {
56+
isNonStable(candidate.version) && !isNonStable(currentVersion)
57+
}
58+
59+
// Example 3: using the full syntax
60+
resolutionStrategy {
61+
componentSelection {
62+
all {
63+
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
64+
reject('Release candidate')
65+
}
66+
}
67+
}
68+
}
69+
}
70+
71+
//////////////////////////////////////////////
72+
/// Dokka: https://github.com/Kotlin/dokka ///
73+
//////////////////////////////////////////////
74+
75+
apply plugin: 'org.jetbrains.dokka'
76+
3077
// Dokka's configuration.externalDocumentationLink.url setting for connecting methods/variables
3178
// in each module is quarky, especially when relying on Mkdocs to generate a website using the
3279
// Markdown files that are created. the `externalDocumentationLink.url` setting requires a
@@ -37,7 +84,3 @@ task fixDokkaDocLinks(type: Exec) {
3784
workingDir "$rootDir"
3885
commandLine "scripts/fix_dokka_doc_external_links.sh"
3986
}
40-
41-
task clean(type: Delete) {
42-
delete rootProject.buildDir
43-
}

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
## Version 1.0.0-alpha02 (2020-08-03)
2626
- API breaking changes were made to `TorServiceController.Builder`. See the following to update:
2727
- [TorServiceController.Builder](./topl-service/io.matthewnelson.topl_service/-tor-service-controller/-builder/index.md)
28-
- [TorServiceEventBroadcaster](./topl-service/io.matthewnelson.topl_service.service.components.onionproxy.model/-tor-service-event-broadcaster/index.md)
28+
- [TorServiceEventBroadcaster](./topl-service-base/io.matthewnelson.topl_service_base/-tor-service-event-broadcaster/index.md)
2929
- Added ability to hide the notification
3030
- NOTE: Will be shown when user swipes the application out of recent's tray (required).
3131
- Service now starts via `Context.startService` + `Context.bindService` instead of starting

docs/documentation.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
## [topl-service](./topl-service/index.md)
44

5+
## [topl-service-base](./topl-service-base/index.md)
6+
57
## [topl-core-base](./topl-core-base/index.md)
68

7-
<!-- Hold off linking to docs until release -->
9+
<!-- Hold off linking to docs until refactor is complete -->
810
<!-- ## [topl-core](./topl-core/io.matthewnelson.topl_core/index.md) -->
911

1012
!!! Info
1113
Documentation here only includes **Public** methods/classes, meaning links to non-public
1214
methods/classes are broken. You can view all methods/classes from the Project View in
13-
Android Studio via: `Project/External Libraries/io.matthewnelson.topl_android:topl_*@arr`
15+
Android Studio via: `Project/External Libraries/io.matthewnelson.topl_android:topl_*@arr`
16+
17+
## [Migrations](./migration.md)

docs/get_started.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Get Started
1717
- **torrc file**:
1818
- Not needed
1919
- Your application's `torrc` file gets created for you based on what you have stored in
20-
[TorServicePrefs](./topl-service/io.matthewnelson.topl_service.prefs/-tor-service-prefs/index.md).
20+
[TorServicePrefs](./topl-service-base/io.matthewnelson.topl_service_base/-tor-service-prefs/index.md).
2121
If nothing is in `TorServicePrefs` for that particular setting, then it will fall back on
2222
your static/default [TorSettings](./topl-core-base/io.matthewnelson.topl_core_base/-tor-settings/index.md)
2323
that you supply upon initialization of `TorServiceController.Builder`.
@@ -56,9 +56,7 @@ Get Started
5656
## Implementation - Step 2: topl-service
5757
- In your Application module's `build.gradle` file, add the following to the `dependencies` block:
5858
```groovy
59-
def topl_android_version = "{{ topl_android.release }}"
60-
implementation "io.matthewnelson.topl-android:topl-core-base:$topl_android_version"
61-
implementation "io.matthewnelson.topl-android:topl-service:$topl_android_version"
59+
implementation "io.matthewnelson.topl-android:topl-service:{{ topl_android.release }}"
6260
```
6361
6462
- Create a new class which extends [TorSettings](./topl-core-base/io.matthewnelson.topl_core_base/-tor-settings/index.md)
@@ -87,9 +85,7 @@ Get Started
8785
8886
- In your Application module's `build.gradle` file, add (or modify) the following in the `dependencies` block:
8987
```groovy
90-
def topl_android_version = "{{ topl_android.next_release }}-SNAPSHOT"
91-
implementation 'io.matthewnelson.topl-android:topl-core-base:$topl_android_version'
92-
implementation 'io.matthewnelson.topl-android:topl-service:$topl_android_version'
88+
implementation 'io.matthewnelson.topl-android:topl-service:{{ topl_android.next_release }}-SNAPSHOT'
9389
```
9490
9591
!!! Warning

docs/index.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,21 @@ The following exception is an additional permission under section 7 of the
6868
GNU General Public License, version 3 (“GPLv3”).
6969

7070
"The Interfaces" is henceforth defined as Application Programming Interfaces
71-
that are publicly available classes/functions/etc (ie: do not contain the
72-
visibility modifiers `internal`, `private`, `protected`, or are within
73-
classes/functions/etc that contain the aforementioned visibility modifiers)
74-
to TorOnionProxyLibrary-Android users that are needed to implement
75-
TorOnionProxyLibrary-Android and reside in ONLY the following modules:
71+
needed to implement TorOnionProxyLibrary-Android, as listed below:
7672

77-
- topl-core-base
78-
- topl-service
73+
- From the `topl-core-base` module:
74+
- All Classes/methods/variables
7975

80-
The following are excluded from "The Interfaces":
76+
- From the `topl-service-base` module:
77+
- All Classes/methods/variables
78+
79+
- From the `topl-service` module:
80+
- The TorServiceController class and it's contained classes/methods/variables
81+
- The ServiceNotification.Builder class and it's contained classes/methods/variables
82+
- The BackgroundManager.Builder class and it's contained classes/methods/variables
83+
- The BackgroundManager.Companion class and it's contained methods/variables
84+
85+
The following code is excluded from "The Interfaces":
8186

8287
- All other code
8388

docs/migration.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Migration
2+
3+
## Migrating from 1.0.0 to 2.0.0
4+
- Your Application's `TorSettings` class needs to now extend
5+
[ApplicationDefaultTorSettings](./topl-service-base/io.matthewnelson.topl_service_base/-application-default-tor-settings/index.md)
6+
- Remove and re-import class paths, as all non-Builder classes were moved to the
7+
`topl-service-base` module
8+
- The `topl-core-base` dependency is no longer required as it is automatically provided with
9+
`topl-service`. If you have a `Tor` module, other module's depending on it need only
10+
import the `topl-service-base` module now as all visible classes/abstractions have been moved there.
11+
- The `TorServiceController.getServiceTorSettings` no longer requires context

docs/releasing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ extra:
3131

3232
- Generate the Dokka docs
3333
```
34-
rm -rf docs/topl-core docs/topl-core-base docs/topl-service
35-
./gradlew topl-core-base:dokka topl-core:dokka topl-service:dokka
34+
rm -rf docs/topl-core docs/topl-core-base docs/topl-service-base docs/topl-service
35+
./gradlew topl-core-base:dokka topl-core:dokka topl-service-base:dokka topl-service:dokka
3636
```
3737

3838
- Fix Dokka doc links

docs/topl-core-base/io.matthewnelson.topl_core_base/-base-consts/-broadcast-type/-d-e-b-u-g.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# DEBUG
44

5-
`const val DEBUG: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core-base/src/main/java/io/matthewnelson/topl_core_base/BaseConsts.kt#L93)
5+
`const val DEBUG: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core-base/src/main/java/io/matthewnelson/topl_core_base/BaseConsts.kt#L98)

docs/topl-core-base/io.matthewnelson.topl_core_base/-base-consts/-broadcast-type/-e-r-r-o-r.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# ERROR
44

5-
`const val ERROR: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core-base/src/main/java/io/matthewnelson/topl_core_base/BaseConsts.kt#L94)
5+
`const val ERROR: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core-base/src/main/java/io/matthewnelson/topl_core_base/BaseConsts.kt#L99)

0 commit comments

Comments
 (0)