Skip to content

Commit 0f65bab

Browse files
authored
Merge pull request #4 from touchlab/sh/structure
KtLint and cleanup
2 parents 0f749f1 + 74c3722 commit 0f65bab

File tree

20 files changed

+130
-120
lines changed

20 files changed

+130
-120
lines changed

.gitignore

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,15 @@
1-
.DS_Store
2-
.idea/shelf
3-
*.iml
4-
/dependencies/all
5-
dist
6-
kotlin-native-*.tar.gz
7-
translator/src/test/kotlin/tests/*/linked
8-
out
9-
tmp
10-
workspace.xml
11-
*.versionsBackup
12-
131
local.properties
142
.gradle
15-
build
16-
translator/.gradle/2.9/taskArtifacts
17-
18-
kotstd/kotstd.iml
19-
20-
# test suit products.
21-
*.bc.o
22-
*.kt.S
23-
*.kt.exe
24-
*.log
25-
test.output
26-
*.kexe
27-
28-
# Ignore Gradle GUI config
29-
gradle-app.setting
30-
31-
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
32-
!gradle-wrapper.jar
3+
build/
334

34-
# Cache of project
35-
.gradletasknamecache
5+
.idea/**/*
6+
!.idea/inspectionProfiles/
7+
!.idea/inspectionProfiles/**
8+
!.idea/codeStyles/
9+
!.idea/codeStyles/**
3610

37-
# local project files
38-
lib/
39-
.idea/
40-
proto/compiler/protoc-artifacts
41-
proto/compiler/tests
42-
43-
proto/compiler/google/src/google/protobuf/compiler/kotlin/bin
44-
proto/compiler/google/src/google/protobuf/compiler/kotlin/protoc
45-
46-
peformance/build
47-
48-
# translator auto generated artifacts
49-
kotstd/ll
50-
51-
# test teamcity property: commitable only with -f
52-
backend.native/tests/teamcity-test.property
11+
*.iml
5312

54-
# Sample output
55-
samples/**/*.kt.bc-build
56-
samples/androidNativeActivity/Polyhedron
13+
.DS_Store
14+
.vscode
5715

58-
.vscode

.idea/codeStyles/Project.xml

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/ktlint.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

azure-pipelines-build.yml renamed to azure/build-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
jdkArchitectureOption: 'x64'
1919
publishJUnitResults: true
2020
testResultsFiles: '**/TEST-*.xml'
21-
tasks: 'build check'
21+
tasks: 'build'
2222

2323
- job: "Linux"
2424
pool:
@@ -34,7 +34,7 @@ jobs:
3434
jdkArchitectureOption: 'x64'
3535
publishJUnitResults: true
3636
testResultsFiles: '**/TEST-*.xml'
37-
tasks: 'publishLinuxMips32PublicationToMavenLocal' # No test target, but this will ensure it builds
37+
tasks: 'publishLinuxMips32PublicationToMavenLocal linuxX64Test'
3838

3939
- job: "Windows"
4040
pool:

azure-pipelines-deploy.yml renamed to azure/deploy-pipeline.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ jobs:
1010
inputs:
1111
workingDirectory: ''
1212
gradleWrapperFile: 'gradlew'
13+
options: '-Dorg.gradle.internal.http.socketTimeout=120000 -Dorg.gradle.internal.http.connectionTimeout=120000'
1314
gradleOptions: '-Xmx3072m'
1415
javaHomeOption: 'JDKVersion'
1516
jdkVersionOption: '1.8'
1617
jdkArchitectureOption: 'x64'
17-
publishJUnitResults: true
18-
testResultsFiles: '**/TEST-*.xml'
1918
tasks: 'publishMac'
2019
env:
2120
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: $(sonatype_user)
@@ -30,12 +29,11 @@ jobs:
3029
inputs:
3130
workingDirectory: ''
3231
gradleWrapperFile: 'gradlew'
32+
options: '-Dorg.gradle.internal.http.socketTimeout=120000 -Dorg.gradle.internal.http.connectionTimeout=120000'
3333
gradleOptions: '-Xmx3072m'
3434
javaHomeOption: 'JDKVersion'
3535
jdkVersionOption: '1.8'
3636
jdkArchitectureOption: 'x64'
37-
publishJUnitResults: true
38-
testResultsFiles: '**/TEST-*.xml'
3937
tasks: 'publishLinux'
4038
env:
4139
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: $(sonatype_user)
@@ -50,12 +48,11 @@ jobs:
5048
inputs:
5149
workingDirectory: ''
5250
gradleWrapperFile: 'gradlew'
51+
options: '-Dorg.gradle.internal.http.socketTimeout=120000 -Dorg.gradle.internal.http.connectionTimeout=120000'
5352
gradleOptions: '-Xmx3072m'
5453
javaHomeOption: 'JDKVersion'
5554
jdkVersionOption: '1.8'
5655
jdkArchitectureOption: 'x64'
57-
publishJUnitResults: true
58-
testResultsFiles: '**/TEST-*.xml'
5956
tasks: 'publishWindows'
6057
env:
6158
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: $(sonatype_user)

build.gradle

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@ buildscript {
1919
jcenter()
2020
google()
2121
gradlePluginPortal()
22-
// maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
2322
}
2423

2524
dependencies {
2625
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
26+
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.2.1"
2727
}
2828
}
2929

3030
apply plugin: 'org.jetbrains.kotlin.multiplatform'
3131

3232
repositories {
3333
mavenCentral()
34-
// maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
3534
}
3635

3736
group = GROUP
3837
version = VERSION_NAME
3938

4039
kotlin {
41-
targets {
42-
// macosX64("nativeCommon")
4340
jvm()
44-
js()
41+
js {
42+
browser()
43+
nodejs()
44+
}
4545
macosX64()
4646
iosArm32()
4747
iosArm64()
@@ -54,10 +54,7 @@ kotlin {
5454
tvosX64()
5555
linuxArm32Hfp()
5656
linuxMips32()
57-
// androidNativeArm32()
58-
// androidNativeArm64()
5957
mingwX64()
60-
}
6158
sourceSets {
6259
commonMain {
6360
dependencies {
@@ -112,9 +109,6 @@ kotlin {
112109
targets.linuxX64,
113110
targets.linuxArm32Hfp,
114111
targets.linuxMips32
115-
// ,
116-
// targets.androidNativeArm32,
117-
// targets.androidNativeArm64
118112
]) {
119113
compilations.main.source(sourceSets.nativeCommonMain)
120114
compilations.test.source(sourceSets.nativeCommonTest)
@@ -164,4 +158,20 @@ allprojects {
164158
dependsOn 'publishLinuxMips32PublicationToMavenRepository'
165159
}
166160
}
167-
}
161+
162+
apply plugin: "org.jlleitschuh.gradle.ktlint"
163+
ktlint {
164+
version.set("0.37.2")
165+
enableExperimentalRules.set(true)
166+
verbose.set(true)
167+
filter {
168+
exclude { it.file.path.contains("build/") }
169+
}
170+
}
171+
172+
afterEvaluate {
173+
tasks.named("check").configure {
174+
dependsOn(tasks.getByName("ktlintCheck"))
175+
}
176+
}
177+
}

runtest.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/commonMain/kotlin/co/touchlab/testhelp/Functions.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ expect val isMultithreaded: Boolean
1616
* you want.
1717
*/
1818
val <T> T.isNativeFrozen: Boolean
19-
get() = !isNative || isFrozen
20-
19+
get() = !isNative || isFrozen
2120

2221
/**
2322
* Determine if object is frozen. Will return false on non-native platforms.
2423
*/
25-
expect val <T> T.isFrozen: Boolean
24+
expect val <T> T.isFrozen: Boolean

0 commit comments

Comments
 (0)