Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package name to systems.danger for all the project #60

Merged
merged 8 commits into from
Jan 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dangerfile.df.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@file:Repository("https://repo.maven.apache.org")
//@file:DependsOn("systems.danger.exampleplugin:example:1.0")

import com.danger.dangerkotlin.*
import systems.danger.kotlin.*

val danger = Danger(args)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Is possible to generate a working `danger-kotlin` instance from the code that is
You can make a `Dangerfile.df.kts` in your root project that looks through PR metadata, it's fully typed.

```kotlin
import com.danger.dangerkotlin.*
import systems.danger.kotlin.*
import org.jetbrains.kotlin.script.util.*

val danger = Danger(args)
Expand Down Expand Up @@ -66,7 +66,7 @@ You can activate the autocomplete following this additional steps:
- Install danger on your local machine
- Go to `Preferences -> Build, Execution, Deployment -> Compiler -> Kotlin Compiler` (`Preferences -> Kotlin Compiler` in Android Studio)
- At the bottom you will find a section `Kotlin Scripting`
- Complete the field `Script template classes` with `com.danger.kotlin.kts.DangerFileScript`
- Complete the field `Script template classes` with `systems.danger.kts.DangerFileScript`
- Complete the field `Script templates classpath` with `/usr/local/lib/danger/danger-kotlin.jar`
- Go to `Preferences -> Language & Frameworks -> Kotlin -> Kotlin Scripting`
- Make sure the script template `DangerFileScript` is active and above the default `Kotlin Script`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.kotlin.kts
package systems.danger.kts

import org.jetbrains.kotlin.mainKts.MainKtsConfigurator
import org.jetbrains.kotlin.mainKts.MainKtsEvaluationConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.dangerkotlin
package systems.danger.kotlin

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
Expand All @@ -13,12 +13,12 @@ import com.squareup.moshi.JsonClass
*/
@JsonClass(generateAdapter = true)
data class BitBucketServer(
val metadata: BitBucketServerMetadata,
@Json(name = "pr")
val metadata: BitBucketServerMetadata,
@Json(name = "pr")
val pullRequest: BitBucketServerPR,
val commits: Array<BitBucketServerCommit>,
val comments: Array<BitBucketServerComment>,
val activities: Array<BitBucketServerActivity>
val commits: Array<BitBucketServerCommit>,
val comments: Array<BitBucketServerComment>,
val activities: Array<BitBucketServerActivity>
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand Down Expand Up @@ -55,12 +55,12 @@ data class BitBucketServer(
*/
@JsonClass(generateAdapter = true)
data class BitBucketServerActivity(
val id: Int,
@Json(name = "createdDate")
val id: Int,
@Json(name = "createdDate")
val createdAt: Long,
val user: BitBucketServerUser,
val action: String,
val commentAction: String?
val user: BitBucketServerUser,
val action: String,
val commentAction: String?
)

/**
Expand Down Expand Up @@ -232,14 +232,14 @@ data class BitBucketServerCommentInnerProperties(
*/
@JsonClass(generateAdapter = true)
data class BitBucketServerCommit(
val id: String,
val displayId: String,
val author: BitBucketServerUser,
val authorTimestamp: Long,
val committer: BitBucketServerUser?,
val committerTimestamp: Long,
val message: String,
val parents: Array<BitBucketServerCommitParent>
val id: String,
val displayId: String,
val author: BitBucketServerUser,
val authorTimestamp: Long,
val committer: BitBucketServerUser?,
val committerTimestamp: Long,
val message: String,
val parents: Array<BitBucketServerCommitParent>
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand Down Expand Up @@ -303,24 +303,24 @@ data class BitBucketServerCommitParent(
*/
@JsonClass(generateAdapter = true)
data class BitBucketServerPR(
val id: Int,
val version: Int,
val title: String,
val description: String?,
val state: String,
val open: Boolean,
val closed: Boolean,
@Json(name = "createdDate")
val id: Int,
val version: Int,
val title: String,
val description: String?,
val state: String,
val open: Boolean,
val closed: Boolean,
@Json(name = "createdDate")
val createdAt: Long,
@Json(name = "updatedDate")
@Json(name = "updatedDate")
val updatedAt: Long,
val fromRef: BitBucketServerMergeRef,
val toRef: BitBucketServerMergeRef,
@Json(name = "locked")
val fromRef: BitBucketServerMergeRef,
val toRef: BitBucketServerMergeRef,
@Json(name = "locked")
val isLocked: Boolean,
val author: BitBucketServerParticipant,
val reviewers: Array<BitBucketServerReviewer>,
val participants: Array<BitBucketServerParticipant>
val author: BitBucketServerParticipant,
val reviewers: Array<BitBucketServerReviewer>,
val participants: Array<BitBucketServerParticipant>
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.dangerkotlin
package systems.danger.kotlin

import com.squareup.moshi.Json

Expand All @@ -8,11 +8,11 @@ data class DSL(
)

data class DangerDSL(
@Json(name ="github")
@Json(name ="github")
private val _github: GitHub?,
@Json(name ="bitbucket_server")
@Json(name ="bitbucket_server")
private val _bitBucketServer: BitBucketServer?,
val git: Git
val git: Git
) {
val github: GitHub
get() = _github!!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.dangerkotlin
package systems.danger.kotlin

internal data class DangerResults(
var fails: Array<Violation> = arrayOf(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.dangerkotlin
package systems.danger.kotlin

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
Expand Down Expand Up @@ -70,7 +70,8 @@ internal fun DangerPlugin.withContext(dangerContext: DangerContext) {
private class DangerRunner(jsonInputFilePath: FilePath, jsonOutputPath: FilePath) : DangerContext {
val jsonOutputFile: File = File(jsonOutputPath)
val danger: DangerDSL
val dangerResults: DangerResults = DangerResults()
val dangerResults: DangerResults =
DangerResults()

private val moshi = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
Expand Down Expand Up @@ -191,7 +192,8 @@ fun Danger(args: Array<String>): DangerDSL {
val jsonInputFilePath = args[argsCount - 2]
val jsonOutputPath = args[argsCount - 1]

dangerRunner = DangerRunner(jsonInputFilePath, jsonOutputPath)
dangerRunner =
DangerRunner(jsonInputFilePath, jsonOutputPath)
return dangerRunner.danger
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.dangerkotlin
package systems.danger.kotlin

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.dangerkotlin
package systems.danger.kotlin

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
Expand Down Expand Up @@ -80,29 +80,29 @@ enum class GitHubPullRequestState(val value: String) {
*/
@JsonClass(generateAdapter = true)
data class GitHubPR(
val number: Int,
val title: String,
val body: String,
val user: GitHubUser,
val assignee: GitHubUser?,
val assignees: Array<GitHubUser>,
@Json(name = "created_at") val createdAt: Date,
@Json(name = "updated_at") val updatedAt: Date,
@Json(name = "closed_at") val closedAt: Date?,
@Json(name = "merged_at") val mergedAt: Date?,
val head: GitHubMergeRef,
val base: GitHubMergeRef,
val state: GitHubPullRequestState,
@Json(name = "locked") val isLocked: Boolean,
@Json(name = "merged") val isMerged: Boolean?,
@Json(name = "commits") val commitCount: Int?,
@Json(name = "comments") val commentCount: Int?,
@Json(name = "review_comments") val reviewCommentCount: Int?,
val additions: Int?,
val deletions: Int?,
@Json(name = "changed_files") val changedFiles: Int?,
val milestone: GitHubMilestone?,
@Json(name = "html_url") val htmlURL: String
val number: Int,
val title: String,
val body: String,
val user: GitHubUser,
val assignee: GitHubUser?,
val assignees: Array<GitHubUser>,
@Json(name = "created_at") val createdAt: Date,
@Json(name = "updated_at") val updatedAt: Date,
@Json(name = "closed_at") val closedAt: Date?,
@Json(name = "merged_at") val mergedAt: Date?,
val head: GitHubMergeRef,
val base: GitHubMergeRef,
val state: GitHubPullRequestState,
@Json(name = "locked") val isLocked: Boolean,
@Json(name = "merged") val isMerged: Boolean?,
@Json(name = "commits") val commitCount: Int?,
@Json(name = "comments") val commentCount: Int?,
@Json(name = "review_comments") val reviewCommentCount: Int?,
val additions: Int?,
val deletions: Int?,
@Json(name = "changed_files") val changedFiles: Int?,
val milestone: GitHubMilestone?,
@Json(name = "html_url") val htmlURL: String
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.danger.dangerkotlin
package systems.danger.kotlin

class Violation(message: String) {
val message: String
Expand Down

This file was deleted.

Loading