Skip to content

Commit 8509654

Browse files
committed
Move libraries into separate repository
1 parent 9ce9d09 commit 8509654

Some content is hidden

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

66 files changed

+144
-8033
lines changed

.gitignore

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
!/.gitignore
3+
!/.gitmodules
34
!/build.gradle
5+
!/chan.properties
46
!/COPYING
57
!/engines
68
/engines/*/*
@@ -15,10 +17,6 @@
1517
!/gradle
1618
!/gradlew
1719
!/gradlew.bat
18-
!/libraries
19-
/libraries/*/*
20-
!/libraries/*/build.gradle
21-
!/libraries/*/res
22-
!/libraries/*/src
20+
!/library
2321
!/README.md
2422
!/settings.gradle

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "library"]
2+
path = library
3+
url = https://github.com/Mishiranu/Dashchan-Library.git

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Dashchan Extensions
22

3-
Extensions and libraries.
3+
This repositories contains supported extensions.
44

55
Old extensions are placed under their own specific branch. It's planned to move them all into master branch.
66

77
## Building Guide
88

99
1. Install JDK 8 or higher
1010
2. Install Android SDK, define `ANDROID_HOME` environment variable or set `sdk.dir` in `local.properties`
11-
4. Run `./gradlew :extensions:%CHAN_NAME%:assembleRelease`
11+
3. Run `./gradlew :extensions:%CHAN_NAME%:assembleRelease`
1212

1313
The resulting APK file will appear in `extensions/%CHAN_NAME%/build/outputs/apk` directory.
1414

@@ -25,4 +25,4 @@ key.password=%KEY_PASSWORD%
2525

2626
## License
2727

28-
Extensions and libraries are available under the [GNU General Public License, version 3 or later](COPYING).
28+
Extensions are available under the [GNU General Public License, version 3 or later](COPYING).

build.gradle

+2-193
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.6.4'
8+
classpath 'com.android.tools.build:gradle:4.1.3'
9+
classpath 'chan.library:plugins:0'
910
}
1011
}
1112

@@ -15,195 +16,3 @@ allprojects {
1516
mavenCentral()
1617
}
1718
}
18-
19-
class GenerateFileTask extends DefaultTask {
20-
@Input String inputText
21-
@OutputFile File outputFile
22-
23-
@TaskAction
24-
def action() {
25-
outputFile.write(inputText)
26-
}
27-
}
28-
29-
def configureCommon(project, manifestFile) {
30-
project.android {
31-
compileSdkVersion 30
32-
buildToolsVersion '30.0.2'
33-
34-
defaultConfig {
35-
minSdkVersion 16
36-
targetSdkVersion 30
37-
}
38-
39-
sourceSets.main {
40-
manifest.srcFile manifestFile
41-
java.srcDirs = ['src']
42-
resources.srcDirs = []
43-
aidl.srcDirs = ['src']
44-
renderscript.srcDirs = ['src']
45-
res.srcDirs = ['res']
46-
assets.srcDirs = ['assets']
47-
}
48-
49-
compileOptions {
50-
sourceCompatibility JavaVersion.VERSION_1_8
51-
targetCompatibility JavaVersion.VERSION_1_8
52-
}
53-
}
54-
}
55-
56-
project.ext.set 'configureLibrary', { project ->
57-
project.apply plugin: 'com.android.library'
58-
59-
def packageName = 'chan.library.' + project.name
60-
def xml = '<?xml version="1.0" encoding="utf-8"?>\n' +
61-
'<manifest xmlns:android="http://schemas.android.com/apk/res/android" ' +
62-
"package=\"$packageName\" />"
63-
64-
def manifestFile = new File(project.buildDir, 'generated/AndroidManifest.xml')
65-
if (!manifestFile.exists()) {
66-
// Fixes IntelliJ Android plugin error
67-
manifestFile.parentFile.mkdirs()
68-
manifestFile.write(xml)
69-
}
70-
71-
project.preBuild.dependsOn(project.task('generateManifest', type: GenerateFileTask) {
72-
inputText = xml
73-
outputFile = manifestFile
74-
})
75-
76-
configureCommon(project, manifestFile)
77-
}
78-
79-
project.ext.set 'configureExtension', { project, data ->
80-
project.apply plugin: 'com.android.application'
81-
82-
def keyNotFound = { throw new NullPointerException(it + ' is not defined') }
83-
84-
def chanName = project.name
85-
def packageName = data['packageName'] ?: 'com.mishiranu.dashchan.chan.' + chanName
86-
def chanNameUpper = data['chanNameUpper'] ?: chanName.take(1).toUpperCase() + chanName.substring(1)
87-
def versionName = data['versionName'] ?: keyNotFound('versionName')
88-
def apiVersion = data['apiVersion'] ?: keyNotFound('apiVersion')
89-
def icon = data['icon'] ?: 'ic_custom_' + chanName
90-
def updateUri = data['updateUri'] ?: '//raw.githubusercontent.com/Mishiranu/Dashchan/master/update/data.json'
91-
def hosts = data['hosts'] ?: keyNotFound('hosts')
92-
def customUriHandler = data['customFilter'] ?: false
93-
def customFilter = data['customFilter']
94-
def chanTitle = hosts[0]
95-
96-
def requiredClasses = ['ChanConfiguration', 'ChanLocator', 'ChanMarkup', 'ChanPerformer']
97-
.collect { packageName + '.' + chanNameUpper + it }
98-
99-
def xml = '<?xml version="1.0" encoding="utf-8"?>\n' +
100-
'<manifest xmlns:android="http://schemas.android.com/apk/res/android" ' +
101-
"package=\"$packageName\" android:versionCode=\"1\" android:versionName=\"$versionName\">\n"
102-
xml += '<uses-feature android:name="chan.extension" />\n'
103-
xml += '<application android:icon="@null" android:allowBackup="false" ' +
104-
"android:label=\"Dashchan for ${chanTitle}\">\n"
105-
xml += "<meta-data android:name=\"chan.extension.name\" android:value=\"$chanName\" />\n"
106-
xml += "<meta-data android:name=\"chan.extension.title\" android:value=\"${chanTitle}\" />\n"
107-
xml += "<meta-data android:name=\"chan.extension.version\" android:value=\"$apiVersion\" />\n"
108-
xml += "<meta-data android:name=\"chan.extension.icon\" android:resource=\"@drawable/$icon\" />\n"
109-
xml += "<meta-data android:name=\"chan.extension.source\" android:value=\"$updateUri\" />\n"
110-
xml += '<meta-data android:name="chan.extension.class.configuration" ' +
111-
"android:value=\".${chanNameUpper}ChanConfiguration\" />\n"
112-
xml += '<meta-data android:name="chan.extension.class.performer" ' +
113-
"android:value=\".${chanNameUpper}ChanPerformer\" />\n"
114-
xml += '<meta-data android:name="chan.extension.class.locator" ' +
115-
"android:value=\".${chanNameUpper}ChanLocator\" />\n"
116-
xml += '<meta-data android:name="chan.extension.class.markup" ' +
117-
"android:value=\".${chanNameUpper}ChanMarkup\" />\n"
118-
xml += '<activity android:name="chan.application.UriHandlerActivity" ' +
119-
'android:label="Dashchan" android:theme="@android:style/Theme.NoDisplay">\n'
120-
xml += '<intent-filter>\n' +
121-
'<action android:name="android.intent.action.VIEW" />\n' +
122-
'<category android:name="android.intent.category.DEFAULT" />\n' +
123-
'<category android:name="android.intent.category.BROWSABLE" />\n'
124-
if (customFilter != null) {
125-
xml += customFilter
126-
} else {
127-
xml += '<data android:scheme="http" />\n' +
128-
'<data android:scheme="https" />\n'
129-
for (host in hosts) {
130-
xml += "<data android:host=\"$host\" />\n"
131-
}
132-
}
133-
xml += '</intent-filter>\n</activity>\n</application>\n</manifest>\n'
134-
135-
def proguard = '-dontobfuscate\n' + requiredClasses
136-
.collect { '-keep class ' + it + ' { *; }\n' }.join()
137-
138-
def manifestFile = new File(project.buildDir, 'generated/AndroidManifest.xml')
139-
def proguardFile = new File(project.buildDir, 'generated/proguard-rules.pro')
140-
if (!manifestFile.exists()) {
141-
// Fixes IntelliJ Android plugin error
142-
manifestFile.parentFile.mkdirs()
143-
manifestFile.write('<?xml version="1.0" encoding="utf-8"?>\n' +
144-
'<manifest xmlns:android="http://schemas.android.com/apk/res/android" ' +
145-
"package=\"$packageName\" />")
146-
}
147-
148-
project.preBuild.dependsOn(project.task('generateManifest', type: GenerateFileTask) {
149-
inputText = xml
150-
outputFile = manifestFile
151-
})
152-
project.preBuild.dependsOn(project.task('generateProguard', type: GenerateFileTask) {
153-
inputText = proguard
154-
outputFile = proguardFile
155-
})
156-
157-
project.archivesBaseName = 'Dashchan' + chanNameUpper
158-
configureCommon(project, manifestFile)
159-
160-
project.android {
161-
defaultConfig {
162-
// Don't warn about unused classes
163-
buildConfigField 'Class[]', 'USED_CLASSES',
164-
'{' + requiredClasses.collect { it + '.class' }.join(', ') + '}'
165-
}
166-
167-
if (file('keystore.properties').exists()) {
168-
def keystoreProperties = new Properties()
169-
keystoreProperties.load(new FileInputStream(file('keystore.properties')))
170-
171-
signingConfigs {
172-
general {
173-
storeFile file(keystoreProperties['store.file'])
174-
storePassword keystoreProperties['store.password']
175-
keyAlias keystoreProperties['key.alias']
176-
keyPassword keystoreProperties['key.password']
177-
}
178-
}
179-
180-
buildTypes.debug.signingConfig signingConfigs.general
181-
buildTypes.release.signingConfig signingConfigs.general
182-
}
183-
184-
buildTypes {
185-
debug {
186-
minifyEnabled false
187-
}
188-
release {
189-
minifyEnabled true
190-
}
191-
all {
192-
crunchPngs false
193-
proguardFiles getDefaultProguardFile('proguard-android.txt'), proguardFile
194-
}
195-
}
196-
197-
lintOptions {
198-
abortOnError false
199-
disable 'MissingTranslation'
200-
}
201-
}
202-
203-
project.dependencies {
204-
compileOnly project.project(':libraries:api')
205-
if (!customUriHandler) {
206-
implementation project.project(':libraries:urihandler')
207-
}
208-
}
209-
}

chan.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package.prefix=com.mishiranu.dashchan.chan
2+
update.uri=//raw.githubusercontent.com/Mishiranu/Dashchan/master/update/data.json

engines/foolfuuka/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
rootProject.configureLibrary(project)
1+
apply plugin: 'chan-library'
22

33
dependencies {
4-
compileOnly project(':libraries:api')
5-
api project(':libraries:templateparser')
4+
compileOnly 'chan.library:api:0'
5+
api 'chan.library:template-parser:0'
66
}

engines/wakaba/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
rootProject.configureLibrary(project)
1+
apply plugin: 'chan-library'
22

33
dependencies {
4-
compileOnly project(':libraries:api')
5-
api project(':libraries:templateparser')
4+
compileOnly 'chan.library:api:0'
5+
api 'chan.library:template-parser:0'
66
}

extensions/archiverbt/build.gradle

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
rootProject.configureExtension(project, [
2-
chanNameUpper: 'ArchiveRbt',
3-
versionName: '1.8',
4-
apiVersion: 1,
5-
hosts: ['rbt.asia', 'www.rbt.asia', 'archive.rebeccablacktech.com']
6-
])
1+
apply plugin: 'chan-extension'
2+
3+
chan {
4+
nameUpper 'ArchiveRbt'
5+
versionName '1.8'
6+
apiVersion 1
7+
hosts 'rbt.asia', 'www.rbt.asia', 'archive.rebeccablacktech.com'
8+
}
79

810
dependencies {
911
implementation project(':engines:foolfuuka')

extensions/arhivach/build.gradle

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
rootProject.configureExtension(project, [
2-
versionName: '1.12',
3-
apiVersion: 1,
4-
icon: 'ic_storage',
5-
hosts: ['arhivach.net', 'arhivach.org', 'arhivach.cf', 'arhivach.ng', 'arhivachovtj2jrp.onion']
6-
])
1+
apply plugin: 'chan-extension'
2+
3+
chan {
4+
versionName '1.12'
5+
apiVersion 1
6+
icon 'ic_storage'
7+
hosts 'arhivach.net', 'arhivach.org', 'arhivach.cf', 'arhivach.ng', 'arhivachovtj2jrp.onion'
8+
}
79

810
dependencies {
9-
implementation project(':libraries:templateparser')
11+
implementation 'chan.library:template-parser:0'
1012
}

extensions/bunbunmaru/build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
rootProject.configureExtension(project, [
2-
versionName: '1.2',
3-
apiVersion: 1,
4-
hosts: ['bunbunmaru.com', 'www.bunbunmaru.com']
5-
])
1+
apply plugin: 'chan-extension'
2+
3+
chan {
4+
versionName '1.2'
5+
apiVersion 1
6+
hosts 'bunbunmaru.com', 'www.bunbunmaru.com'
7+
}
68

79
dependencies {
810
implementation project(':engines:wakaba')

extensions/cirno/build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
rootProject.configureExtension(project, [
2-
versionName: '1.22',
3-
apiVersion: 1,
4-
hosts: ['iichan.hk', 'n.iichan.hk', 'on.iichan.hk', 'iichan.moe', 'closed.iichan.moe']
5-
])
1+
apply plugin: 'chan-extension'
2+
3+
chan {
4+
versionName '1.22'
5+
apiVersion 1
6+
hosts 'iichan.hk', 'n.iichan.hk', 'on.iichan.hk', 'iichan.moe', 'closed.iichan.moe'
7+
}
68

79
dependencies {
810
implementation project(':engines:wakaba')

extensions/desustorage/build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
rootProject.configureExtension(project, [
2-
versionName: '1.5',
3-
apiVersion: 1,
4-
hosts: ['desuarchive.org', 'desustorage.org']
5-
])
1+
apply plugin: 'chan-extension'
2+
3+
chan {
4+
versionName '1.5'
5+
apiVersion 1
6+
hosts 'desuarchive.org', 'desustorage.org'
7+
}
68

79
dependencies {
810
implementation project(':engines:foolfuuka')

extensions/dobrochan/build.gradle

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
rootProject.configureExtension(project, [
2-
versionName: '1.15',
3-
apiVersion: 1,
4-
hosts: ['dobrochan.net', 'dobrochan.com', 'dobrochan.org', 'dobrochan.ru',
5-
'www.dobrochan.net', 'www.dobrochan.com', 'www.dobrochan.org', 'www.dobrochan.ru']
6-
])
1+
apply plugin: 'chan-extension'
2+
3+
chan {
4+
versionName '1.15'
5+
apiVersion 1
6+
hosts 'dobrochan.net', 'dobrochan.com', 'dobrochan.org', 'dobrochan.ru',
7+
'www.dobrochan.net', 'www.dobrochan.com', 'www.dobrochan.org', 'www.dobrochan.ru'
8+
}
79

810
dependencies {
9-
implementation project(':libraries:templateparser')
11+
implementation 'chan.library:template-parser:0'
1012
}

extensions/dvach/build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
rootProject.configureExtension(project, [
2-
versionName: '1.43',
3-
apiVersion: 1,
4-
hosts: ['2ch.hk', '2ch.pm', '2ch.cm', '2ch.re', '2ch.tf', '2ch.wf', '2ch.yt', '2-ch.so']
5-
])
1+
apply plugin: 'chan-extension'
2+
3+
chan {
4+
versionName '1.43'
5+
apiVersion 1
6+
hosts '2ch.hk', '2ch.pm', '2ch.cm', '2ch.re', '2ch.tf', '2ch.wf', '2ch.yt', '2-ch.so'
7+
}

0 commit comments

Comments
 (0)