Skip to content

Commit e778a3a

Browse files
committed
Cleanup repository leaving only samples and samples-tests
Samples tests now use gradle/exemplar Most of them are external samples tests Except for when precise testing is necessary or unsupported by exemplar Samples wrapper update is now done via the regular :wrapper task Signed-off-by: Paul Merlin <paul@gradle.com>
1 parent cd78487 commit e778a3a

File tree

472 files changed

+377
-45262
lines changed

Some content is hidden

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

472 files changed

+377
-45262
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gradle
22
.gradle
3-
/build
3+
build
44

55
# idea
66
.idea

.mrconfig

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

build.gradle.kts

Lines changed: 11 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,22 @@
1-
import org.jetbrains.gradle.ext.CopyrightConfiguration
2-
import org.jetbrains.gradle.ext.ProjectSettings
3-
import org.jetbrains.gradle.ext.TaskTriggersConfig
4-
5-
import java.time.LocalDate
6-
7-
8-
buildscript {
9-
10-
build.loadExtraPropertiesOf(project)
11-
12-
}
13-
141
plugins {
152
base
16-
kotlin("jvm") apply false
17-
id("org.jetbrains.gradle.plugin.idea-ext") version "0.4.2"
18-
}
19-
20-
allprojects {
21-
group = "org.gradle"
22-
version = "1.2.0-SNAPSHOT"
23-
}
24-
25-
val publishedPluginsVersion by extra { "1.1.3" }
26-
val futurePluginsVersion = "1.1.4"
27-
project(":plugins") {
28-
group = "org.gradle.kotlin"
29-
version = futurePluginsVersion
303
}
314

32-
// --- Configure publications ------------------------------------------
33-
val distributionProjects =
34-
listOf(
35-
project(":provider"),
36-
project(":provider-plugins"),
37-
project(":tooling-models"),
38-
project(":tooling-builders"))
5+
tasks {
396

40-
// For documentation and meaningful `./gradlew dependencies` output
41-
val distribution by configurations.creating
42-
dependencies {
43-
distributionProjects.forEach {
44-
distribution(it)
45-
}
46-
}
47-
48-
allprojects {
49-
repositories {
50-
gradlePluginPortal()
51-
repositories {
52-
maven {
53-
name = "kotlinx"
54-
url = uri("https://kotlin.bintray.com/kotlinx/")
7+
val samplesWrappers by registering {
8+
doLast {
9+
val wrapperFiles = wrapper.get().run {
10+
listOf(scriptFile, batchScript, jarFile, propertiesFile).associateBy { it.name }
11+
}
12+
file("samples").walk().filter { it.isFile && it.name in wrapperFiles.keys }.forEach { sampleWrapperFile ->
13+
wrapperFiles.getValue(sampleWrapperFile.name).copyTo(sampleWrapperFile, overwrite = true)
5514
}
5615
}
5716
}
58-
}
59-
60-
61-
// -- Integration testing ----------------------------------------------
62-
val prepareIntegrationTestFixtures by tasks.registering(GradleBuild::class) {
63-
dir = file("fixtures")
64-
}
65-
66-
val customInstallationDir = file("$buildDir/custom/gradle-${gradle.gradleVersion}")
67-
68-
val copyCurrentDistro by tasks.registering(Copy::class) {
69-
description = "Copies the current Gradle distro into '$customInstallationDir'."
70-
71-
from(gradle.gradleHomeDir)
72-
into(customInstallationDir)
73-
exclude("**/*kotlin*")
74-
75-
// preserve last modified date on each file to make it easier
76-
// to check which files were patched by next step
77-
val copyDetails = mutableListOf<FileCopyDetails>()
78-
eachFile { copyDetails.add(this) }
79-
doLast {
80-
copyDetails.forEach { details ->
81-
File(customInstallationDir, details.path).setLastModified(details.lastModified)
82-
}
83-
}
84-
85-
// don't bother recreating it
86-
onlyIf { !customInstallationDir.exists() }
87-
}
88-
89-
val customInstallation by tasks.registering(Copy::class) {
90-
description = "Copies latest gradle-kotlin-dsl snapshot over the custom installation."
91-
dependsOn(copyCurrentDistro)
92-
from(distribution)
93-
into("$customInstallationDir/lib")
94-
}
95-
9617

97-
// -- Performance testing ----------------------------------------------
98-
val benchmark by tasks.registering(integration.Benchmark::class) {
99-
excludingSamplesMatching(
100-
"android",
101-
"source-control"
102-
)
103-
latestInstallation = customInstallationDir
104-
dependsOn(customInstallation)
105-
}
106-
107-
108-
// -- IntelliJ IDEA configuration --------------------------------------
109-
idea {
110-
project {
111-
this as ExtensionAware
112-
configure<ProjectSettings> {
113-
this as ExtensionAware
114-
doNotDetectFrameworks("android", "web")
115-
configure<TaskTriggersConfig> {
116-
// Build the `customInstallation` after the initial import to:
117-
// 1. ensure generated code is available to the IDE
118-
// 2. allow integration tests to be executed
119-
afterSync(customInstallation.get())
120-
}
121-
configure<CopyrightConfiguration> {
122-
useDefault = "ASL2"
123-
profiles {
124-
create("ASL2") {
125-
keyword = "Copyright"
126-
notice = """
127-
Copyright ${LocalDate.now().year} the original author or authors.
128-
129-
Licensed under the Apache License, Version 2.0 (the "License");
130-
you may not use this file except in compliance with the License.
131-
You may obtain a copy of the License at
132-
133-
http://www.apache.org/licenses/LICENSE-2.0
134-
135-
Unless required by applicable law or agreed to in writing, software
136-
distributed under the License is distributed on an "AS IS" BASIS,
137-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138-
See the License for the specific language governing permissions and
139-
limitations under the License.
140-
""".trimIndent()
141-
}
142-
}
143-
}
144-
}
18+
wrapper {
19+
distributionType = Wrapper.DistributionType.ALL
20+
finalizedBy(samplesWrappers)
14521
}
14622
}

buildSrc/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

buildSrc/build.gradle.kts

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

buildSrc/settings.gradle.kts

Lines changed: 0 additions & 1 deletion
This file was deleted.

buildSrc/src/main/kotlin/accessors/conventions.kt

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

buildSrc/src/main/kotlin/build/ExtraProperties.kt

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

0 commit comments

Comments
 (0)