package app.himawari.filter

import org.slf4j.MDC
import org.springframework.core.Ordered
import org.springframework.core.annotation.Order
import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.security.core.userdetails.UserDetails
import org.springframework.stereotype.Component
import javax.servlet.*

/**
 * Created by cxpqwvtj on 2018/07/29.
 */
@Component
@Order(Ordered.LOWEST_PRECEDENCE - 1)
class UserMDCInsertingServletFilter : Filter {
    private val USER_KEY = "username"

    override fun init(filterConfig: FilterConfig?) {
        // NOP
    }

    override fun doFilter(request: ServletRequest?, response: ServletResponse?, chain: FilterChain) {
        val authentication = SecurityContextHolder.getContext().authentication
        val accessUser = if (authentication == null) {
            "anonymous"
        } else {
            val principal = authentication.principal
            if (principal is UserDetails) {
                principal.username
            } else {
                principal.toString()
            }
        }

        MDC.put(USER_KEY, accessUser)

        try {
            chain.doFilter(request, response)
        } finally {
            MDC.remove(USER_KEY)
        }
    }

    override fun destroy() {
        // NOP
    }
}

Change val variable to static.

package app.himawari.filter

import org.slf4j.MDC
import org.springframework.core.Ordered
import org.springframework.core.annotation.Order
import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.security.core.userdetails.UserDetails
import org.springframework.stereotype.Component
import javax.servlet.*

/**
 * Created by cxpqwvtj on 2018/07/29.
 */
@Component
@Order(Ordered.LOWEST_PRECEDENCE - 1)
class UserMDCInsertingServletFilter : Filter {

    companion object {
        private const val USER_KEY = "username"
    }

    override fun init(filterConfig: FilterConfig?) {
        // NOP
    }

    override fun doFilter(request: ServletRequest?, response: ServletResponse?, chain: FilterChain) {
        val authentication = SecurityContextHolder.getContext().authentication
        val accessUser = if (authentication == null) {
            "anonymous"
        } else {
            val principal = authentication.principal
            if (principal is UserDetails) {
                principal.username
            } else {
                principal.toString()
            }
        }

        MDC.put(USER_KEY, accessUser)

        try {
            chain.doFilter(request, response)
        } finally {
            MDC.remove(USER_KEY)
        }
    }

    override fun destroy() {
        // NOP
    }
}


dependencies {
    implementation("me.champeau.gradle:jmh-gradle-plugin:0.4.8")
    implementation("org.jsoup:jsoup:1.11.3")
    implementation("com.gradle:build-scan-plugin:2.1")
    implementation(project(":configuration"))
    implementation(project(":kotlinDsl"))
    implementation(project(":plugins"))
    implementation(project(":build"))
}

gradlePlugin {
    plugins {
        register("buildscan") {
            id = "gradlebuild.buildscan"
            implementationClass = "org.gradle.gradlebuild.profiling.buildscan.BuildScanPlugin"
        }
    }
}

Update supported build scan plugin to 2.2-rc-1

dependencies {
    implementation("me.champeau.gradle:jmh-gradle-plugin:0.4.8")
    implementation("org.jsoup:jsoup:1.11.3")
    implementation("com.gradle:build-scan-plugin:2.2-rc-1-20190226165117-release")
    implementation(project(":configuration"))
    implementation(project(":kotlinDsl"))
    implementation(project(":plugins"))
    implementation(project(":build"))
}

gradlePlugin {
    plugins {
        register("buildscan") {
            id = "gradlebuild.buildscan"
            implementationClass = "org.gradle.gradlebuild.profiling.buildscan.BuildScanPlugin"
        }
    }
}


package com.chibatching.kotpref

import android.annotation.TargetApi
import android.content.SharedPreferences
import android.os.Build
import com.chibatching.kotpref.pref.StringSetPref

internal class KotprefPreferences(val preferences: SharedPreferences) : SharedPreferences by preferences {

    override fun edit(): SharedPreferences.Editor {
        return KotprefEditor(preferences.edit())
    }

    internal inner class KotprefEditor(val editor: SharedPreferences.Editor) : SharedPreferences.Editor by editor {

        private val prefStringSet: HashMap<String, StringSetPref.PrefMutableSet> by lazy { HashMap<String, StringSetPref.PrefMutableSet>() }

        override fun apply() {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                prefStringSet.forEach { key, set ->
                    editor.putStringSet(key, set)
                    set.syncTransaction()
                }
                prefStringSet.clear()
            }
            editor.apply()
        }

        override fun commit(): Boolean {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                prefStringSet.forEach { key, set ->
                    editor.putStringSet(key, set)
                    set.syncTransaction()
                }
                prefStringSet.clear()
            }
            return editor.commit()
        }

        @TargetApi(Build.VERSION_CODES.HONEYCOMB)
        internal fun putStringSet(key: String, prefSet: StringSetPref.PrefMutableSet): SharedPreferences.Editor {
            prefStringSet.put(key, prefSet)
            return this
        }
    }
}

Remove java 8 api call to avoid crash on Android

package com.chibatching.kotpref

import android.annotation.TargetApi
import android.content.SharedPreferences
import android.os.Build
import com.chibatching.kotpref.pref.StringSetPref
import java.util.*

internal class KotprefPreferences(val preferences: SharedPreferences) : SharedPreferences by preferences {

    override fun edit(): SharedPreferences.Editor {
        return KotprefEditor(preferences.edit())
    }

    internal inner class KotprefEditor(val editor: SharedPreferences.Editor) : SharedPreferences.Editor by editor {

        private val prefStringSet: MutableMap<String, StringSetPref.PrefMutableSet> by lazy { HashMap<String, StringSetPref.PrefMutableSet>() }

        override fun apply() {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                prefStringSet.keys.forEach { key ->
                    prefStringSet[key]?.let {
                        editor.putStringSet(key, it)
                        it.syncTransaction()
                    }
                }
                prefStringSet.clear()
            }
            editor.apply()
        }

        override fun commit(): Boolean {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                prefStringSet.forEach { key, set ->
                    editor.putStringSet(key, set)
                    set.syncTransaction()
                }
                prefStringSet.clear()
            }
            return editor.commit()
        }

        @TargetApi(Build.VERSION_CODES.HONEYCOMB)
        internal fun putStringSet(key: String, prefSet: StringSetPref.PrefMutableSet): SharedPreferences.Editor {
            prefStringSet.put(key, prefSet)
            return this
        }
    }
}


package mixit.repository

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import mixit.model.Ticket
import org.slf4j.LoggerFactory
import org.springframework.core.io.ClassPathResource
import org.springframework.data.mongodb.core.*
import org.springframework.data.mongodb.core.query.Criteria
import org.springframework.data.mongodb.core.query.Query
import org.springframework.data.mongodb.core.query.isEqualTo
import org.springframework.stereotype.Repository

@Repository
class TicketRepository(private val template: ReactiveMongoTemplate,
                       private val objectMapper: ObjectMapper) {

    private val logger = LoggerFactory.getLogger(this.javaClass)

    fun initData() {
        deleteAll().block()
        if (count().block() == 0L) {
            val usersResource = ClassPathResource("data/ticket.json")
            val tickets: List<Ticket> = objectMapper.readValue(usersResource.inputStream)
            tickets.forEach { save(it).block() }
            logger.info("Ticket data initialization complete")
        }
    }

    fun count() = template.count<Ticket>()

    fun save(ticket: Ticket) =
            template.insert(ticket).doOnSuccess { _ -> logger.info("Save new ticket $ticket") }

    fun findAll() = template.findAll<Ticket>()

    fun deleteAll() = template.remove<Ticket>(Query())

    fun deleteOne(id: String) = template.remove<Ticket>(Query(Criteria.where("_id").isEqualTo(id)))

    fun findByEmail(email: String) = template.findOne<Ticket>(Query(Criteria.where("email").isEqualTo(email)))

}

Revert "Prepare lottery: remove all tickets from 2019"

package mixit.repository

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import mixit.model.Ticket
import org.slf4j.LoggerFactory
import org.springframework.core.io.ClassPathResource
import org.springframework.data.mongodb.core.*
import org.springframework.data.mongodb.core.query.Criteria
import org.springframework.data.mongodb.core.query.Query
import org.springframework.data.mongodb.core.query.isEqualTo
import org.springframework.stereotype.Repository

@Repository
class TicketRepository(private val template: ReactiveMongoTemplate,
                       private val objectMapper: ObjectMapper) {

    private val logger = LoggerFactory.getLogger(this.javaClass)

    fun initData() {
        if (count().block() == 0L) {
            val usersResource = ClassPathResource("data/ticket.json")
            val tickets: List<Ticket> = objectMapper.readValue(usersResource.inputStream)
            tickets.forEach { save(it).block() }
            logger.info("Ticket data initialization complete")
        }
    }

    fun count() = template.count<Ticket>()

    fun save(ticket: Ticket) =
            template.insert(ticket).doOnSuccess { _ -> logger.info("Save new ticket $ticket") }

    fun findAll() = template.findAll<Ticket>()

    fun deleteAll() = template.remove<Ticket>(Query())

    fun deleteOne(id: String) = template.remove<Ticket>(Query(Criteria.where("_id").isEqualTo(id)))

    fun findByEmail(email: String) = template.findOne<Ticket>(Query(Criteria.where("email").isEqualTo(email)))

}


package io.gitlab.arturbosch.detekt.core

import org.jetbrains.kotlin.fileClasses.javaFileFacadeFqName
import org.jetbrains.kotlin.psi.KtFile

/**
 * @author Artur Bosch
 */

fun KtFile.unnormalizedContent(): String {
	val lineSeparator = this.getUserData(KtCompiler.LINE_SEPARATOR)
	require(lineSeparator != null) { "No line separator entry for ktFile ${this.javaFileFacadeFqName.asString()}" }
	return this.text.replace("\n", lineSeparator!!)
}

val KtFile.relativePath: String?
	get() = this.getUserData(KtCompiler.RELATIVE_PATH)

Use idea intern line separator replacement

package io.gitlab.arturbosch.detekt.core

import org.jetbrains.kotlin.com.intellij.openapi.util.text.StringUtilRt
import org.jetbrains.kotlin.fileClasses.javaFileFacadeFqName
import org.jetbrains.kotlin.psi.KtFile

/**
 * @author Artur Bosch
 */

fun KtFile.unnormalizedContent(): String {
	val lineSeparator = this.getUserData(KtCompiler.LINE_SEPARATOR)
	require(lineSeparator != null) { "No line separator entry for ktFile ${this.javaFileFacadeFqName.asString()}" }
	return StringUtilRt.convertLineSeparators("\n", lineSeparator!!)
}

val KtFile.relativePath: String?
	get() = this.getUserData(KtCompiler.RELATIVE_PATH)


object PluginVersions {
    val kotlin = "1.2.50"
    val ktlintPlugin = "4.0.0"
    val gradlePublishPlugin = "0.9.10"
    val androidPlugin = "3.1.2"
    val kotlinNativePlugin = "0.7"
    val semver = "1.0.0"
    val gradleWrapper = "4.7"
    val junit = "4.12"
}

Update plugin itself to 4.1.0 version.

object PluginVersions {
    val kotlin = "1.2.50"
    val ktlintPlugin = "4.1.0"
    val gradlePublishPlugin = "0.9.10"
    val androidPlugin = "3.1.2"
    val kotlinNativePlugin = "0.7"
    val semver = "1.0.0"
    val gradleWrapper = "4.7"
    val junit = "4.12"
}


package jetbrains.buildServer.agent

import jetbrains.buildServer.agent.impl.OSTypeDetector
import jetbrains.buildServer.util.OSType
import jetbrains.buildServer.util.StringUtil
import java.io.File

class EnvironmentImpl(private val _fileSystemService: FileSystemService) : Environment {
    override fun tryGetVariable(name: String): String? {
        return System.getenv(name)
    }

    override val paths: Sequence<File>
        get() =
            tryGetVariable(PathEnvironmentVariableName)?.let {
                return StringUtil.splitHonorQuotes(it, File.pathSeparatorChar)
                        .asSequence()
                        .map { File(it) }
                        .filter { _fileSystemService.isExists(it) }
            } ?: emptySequence()

    override val os: OSType
        get() = OSDetector.detect() ?: OSType.UNIX

    companion object {
        private const val PathEnvironmentVariableName = "PATH"
        private val OSDetector = OSTypeDetector()
    }
}

Make .NET CLI more robust in finding dotnet core installation

package jetbrains.buildServer.agent

import jetbrains.buildServer.agent.impl.OSTypeDetector
import jetbrains.buildServer.util.OSType
import jetbrains.buildServer.util.StringUtil
import java.io.File

class EnvironmentImpl(private val _fileSystemService: FileSystemService) : Environment {
    override fun tryGetVariable(name: String): String? {
        return System.getenv(name)
    }

    override val paths: Sequence<File>
        get() =
            (tryGetVariable(PathEnvironmentVariableName)?.let { path ->
                StringUtil.splitHonorQuotes(path, File.pathSeparatorChar)
                        .asSequence()
                        .map { File(it) }
                        .filter { _fileSystemService.isExists(it) }
            } ?: emptySequence()) + getHintPaths()

    override val os: OSType
        get() = OSDetector.detect() ?: OSType.UNIX

    /**
     * Provides a well known paths for tools on each platform.
     */
    private fun getHintPaths(): Sequence<File> = sequence {
        when (os) {
            OSType.MAC -> yield(File("/usr/local/share/dotnet"))
            OSType.UNIX -> yield(File("/usr/share/dotnet"))
            OSType.WINDOWS -> yield(File("C:\\Program Files\\dotnet"))
        }
    }

    companion object {
        private const val PathEnvironmentVariableName = "PATH"
        private val OSDetector = OSTypeDetector()
    }
}


// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.completion.ngram

import com.intellij.completion.ngram.slp.modeling.runners.ModelRunner
import com.intellij.lang.Language
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import com.intellij.psi.SmartPsiElementPointer

class NGramModelRunnerManager {

  private val myModelRunners: MutableMap<Language, ModelRunnerWithCache> = mutableMapOf()

  fun processFile(filePointer: SmartPsiElementPointer<PsiFile>, language: Language) {
    myModelRunners.getOrPut(language, { ModelRunnerWithCache() }).processFile(filePointer)
  }

  fun getModelRunnerForLanguage(language: Language): ModelRunner? {
    return myModelRunners[language]
  }

  companion object {
    fun getInstance(project: Project): NGramModelRunnerManager {
      return ServiceManager.getService(project, NGramModelRunnerManager::class.java)
    }
  }
}

Use string instead of Language as map key (to support plugin unloading)

// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.completion.ngram

import com.intellij.completion.ngram.slp.modeling.runners.ModelRunner
import com.intellij.lang.Language
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import com.intellij.psi.SmartPsiElementPointer

class NGramModelRunnerManager {

  private val myModelRunners: MutableMap<String, ModelRunnerWithCache> = mutableMapOf()

  fun processFile(filePointer: SmartPsiElementPointer<PsiFile>, language: Language) {
    myModelRunners.getOrPut(language.id, { ModelRunnerWithCache() }).processFile(filePointer)
  }

  fun getModelRunnerForLanguage(language: Language): ModelRunner? {
    return myModelRunners[language.id]
  }

  companion object {
    fun getInstance(project: Project): NGramModelRunnerManager {
      return ServiceManager.getService(project, NGramModelRunnerManager::class.java)
    }
  }
}


/*
 * Copyright 2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

tasks.create("print") {
    doLast {
        val list: ListProperty<String> = project.objects.listProperty()

        // Resolve the list
        logger.quiet("The list contains: " + list.get())

        // Add elements to the empty list
        list.add(project.provider { "element-1" })  // Add a provider element
        list.add("element-2")                       // Add a concrete element

        // Resolve the list
        logger.quiet("The list contains: " + list.get())

        // Overwrite the entire list with a new list
        list.set(listOf("element-3", "element-4"))

        // Resolve the list
        logger.quiet("The list contains: " + list.get())

        // Add more elements through a list provider
        list.addAll(project.provider { listOf("element-5", "element-6") })

        // Resolve the list
        logger.quiet("The list contains: " + list.get())
    }
}

Align Kotlin example of `listProperty` sample with Groovy

/*
 * Copyright 2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

task("print") {
    doLast {
        val list: ListProperty<String> = project.objects.listProperty()

        // Resolve the list
        logger.quiet("The list contains: " + list.get())

        // Add elements to the empty list
        list.add(project.provider { "element-1" })  // Add a provider element
        list.add("element-2")                       // Add a concrete element

        // Resolve the list
        logger.quiet("The list contains: " + list.get())

        // Overwrite the entire list with a new list
        list.set(listOf("element-3", "element-4"))

        // Resolve the list
        logger.quiet("The list contains: " + list.get())

        // Add more elements through a list provider
        list.addAll(project.provider { listOf("element-5", "element-6") })

        // Resolve the list
        logger.quiet("The list contains: " + list.get())
    }
}


package org.walleth.data.networks.all

import org.kethereum.model.ChainDefinition
import org.kethereum.model.ChainId
import org.walleth.data.networks.NetworkDefinition

class NetworkDefinition5 : NetworkDefinition {

    override val tokenShortName = "GOR"
    override val tokenName = "Goerli Ether"

    override val chain = ChainDefinition(ChainId(5L), tokenShortName)

    override fun getNetworkName() = "goerli"

    override val infoUrl = "https://goerli.net/#about"

    override val faucets = listOf(
            "https://goerli-faucet.slock.it/?address=%address%"
    )

    override val rpcEndpoints = listOf("https://rpc.goerli.mudit.blog/",
            "https://rpc.slock.it/goerli ",
            "https://goerli.prylabs.net/"
    )

}

Sort by measurement results from @DaveAppleton

package org.walleth.data.networks.all

import org.kethereum.model.ChainDefinition
import org.kethereum.model.ChainId
import org.walleth.data.networks.NetworkDefinition

class NetworkDefinition5 : NetworkDefinition {

    override val tokenShortName = "GOR"
    override val tokenName = "Goerli Ether"

    override val chain = ChainDefinition(ChainId(5L), tokenShortName)

    override fun getNetworkName() = "goerli"

    override val infoUrl = "https://goerli.net/#about"

    override val faucets = listOf(
            "https://goerli-faucet.slock.it/?address=%address%"
    )

    override val rpcEndpoints = listOf(
            "https://rpc.slock.it/goerli ",
            "https://goerli.prylabs.net",
            "https://rpc.goerli.mudit.blog"
    )

}


Define a model type for a module-less binding

/*
 * Copyright 2020 Michael Rozumyanskiy
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.michaelrocks.lightsaber.processor.model

data class Binding(
  val dependency: Dependency,
  val ancestor: Dependency
)


Add integration test for Spotify tag - DOES NOT YET PASS.

package com.eden.orchid.writersblocks.tags

import com.eden.orchid.impl.generators.HomepageGenerator
import com.eden.orchid.strikt.asHtml
import com.eden.orchid.strikt.innerHtmlMatches
import com.eden.orchid.strikt.matchCountIs
import com.eden.orchid.strikt.matches
import com.eden.orchid.strikt.pageWasRendered
import com.eden.orchid.strikt.select
import com.eden.orchid.testhelpers.OrchidIntegrationTest
import com.eden.orchid.testhelpers.withGenerator
import com.eden.orchid.writersblocks.WritersBlocksModule
import kotlinx.html.iframe
import kotlinx.html.p
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import strikt.api.expectThat

class SpotifyTagTest : OrchidIntegrationTest(withGenerator<HomepageGenerator>(), WritersBlocksModule()) {

    @Test
    @DisplayName("Test Spotify tag as track embed")
    fun test01() {
        serveOn(8080)

        resource(
            "homepage.md",
            """
            |---
            |test: true
            |---
            |{% spotify 'track' '0Vkk4vLcrUTYODEiuV9ECP' %}
            """.trimMargin()
        )

        expectThat(execute())
            .pageWasRendered("/index.html") {
                get { content }
                    .asHtml()
                    .select("body") {
                        innerHtmlMatches() {
                            iframe {
                                src = "..."
                            }
                        }
                    }
            }
    }
}


package lt.markmerkk.tickets

import lt.markmerkk.Tags
import lt.markmerkk.entities.TicketStatus
import net.rcarz.jiraclient.JiraClient
import net.rcarz.jiraclient.JiraException
import net.rcarz.jiraclient.Project
import net.rcarz.jiraclient.Status
import org.slf4j.LoggerFactory
import rx.Emitter
import rx.functions.Action1

class JiraProjectStatusesEmitter(
        private val jiraClient: JiraClient
) : Action1<Emitter<List<Status>>> {

    override fun call(emitter: Emitter<List<Status>>) {
        try {
            val projectStatuses = jiraClient.projects
                    .flatMap { jiraClient.getProjectStatuses(it.key) }
            logger.info("Found ${projectStatuses.size} project statuses.")
            emitter.onNext(projectStatuses)
            emitter.onCompleted()
        } catch (e: IllegalStateException) {
            logger.info("Jira project statuses ${e.message}")
            emitter.onCompleted()
        } catch (e: IllegalArgumentException) {
            logger.error("Jira project statuses error: ${e.message}")
            emitter.onError(e)
        } catch (e: JiraException) {
            logger.error("Jira error: ${e.message}")
            emitter.onError(e)
        }
    }

    companion object {
        private val logger = LoggerFactory.getLogger(Tags.JIRA)
    }

}

Fix filter for ticket status

package lt.markmerkk.tickets

import lt.markmerkk.Tags
import lt.markmerkk.entities.TicketStatus
import net.rcarz.jiraclient.JiraClient
import net.rcarz.jiraclient.JiraException
import net.rcarz.jiraclient.Project
import net.rcarz.jiraclient.Status
import org.slf4j.LoggerFactory
import rx.Emitter
import rx.functions.Action1

class JiraProjectStatusesEmitter(
        private val jiraClient: JiraClient
) : Action1<Emitter<List<Status>>> {

    override fun call(emitter: Emitter<List<Status>>) {
        try {
            val projects = jiraClient.projects
            logger.info("Found ${projects.size} projects.")
            val projectStatuses = projects
                    .flatMap { jiraClient.getProjectStatuses(it.key) }
                    .map { it.name to it } // status cannot be compared, so using map to filter
                    .toMap()
            logger.info("Found ${projectStatuses.size} project statuses.")
            emitter.onNext(projectStatuses.values.toList())
            emitter.onCompleted()
        } catch (e: IllegalStateException) {
            logger.info("Jira project statuses ${e.message}")
            emitter.onCompleted()
        } catch (e: IllegalArgumentException) {
            logger.error("Jira project statuses error: ${e.message}")
            emitter.onError(e)
        } catch (e: JiraException) {
            logger.error("Jira error: ${e.message}")
            emitter.onError(e)
        }
    }

    companion object {
        private val logger = LoggerFactory.getLogger(Tags.JIRA)
    }

}


package app.cash.sqldelight.core.lang

import app.cash.sqldelight.core.SqlDelightProjectService
import app.cash.sqldelight.core.SqldelightParserUtil
import app.cash.sqldelight.core.lang.psi.FunctionExprMixin
import com.alecstrong.sql.psi.core.DialectPreset
import com.alecstrong.sql.psi.core.psi.SqlTypes
import com.intellij.openapi.project.Project

internal class ParserUtil {
  private var dialect: DialectPreset? = null

  fun initializeDialect(project: Project) {
    val newDialect = SqlDelightProjectService.getInstance(project).dialectPreset
    if (newDialect != dialect) {
      newDialect.setup()
      SqldelightParserUtil.overrideSqlParser()
      dialect = newDialect

      val currentElementCreation = SqldelightParserUtil.createElement
      SqldelightParserUtil.createElement = {
        when (it.elementType) {
          SqlTypes.FUNCTION_EXPR -> FunctionExprMixin(it)
          else -> currentElementCreation(it)
        }
      }
    }
  }
}

Reset parser in between tests

package app.cash.sqldelight.core.lang

import app.cash.sqldelight.core.SqlDelightProjectService
import app.cash.sqldelight.core.SqldelightParserUtil
import app.cash.sqldelight.core.lang.psi.FunctionExprMixin
import com.alecstrong.sql.psi.core.DialectPreset
import com.alecstrong.sql.psi.core.SqlParserUtil
import com.alecstrong.sql.psi.core.psi.SqlTypes
import com.intellij.openapi.project.Project

internal class ParserUtil {
  private var dialect: DialectPreset? = null

  fun initializeDialect(project: Project) {
    val newDialect = SqlDelightProjectService.getInstance(project).dialectPreset
    if (newDialect != dialect) {
      SqlParserUtil.reset()
      SqldelightParserUtil.reset()

      newDialect.setup()
      SqldelightParserUtil.overrideSqlParser()
      dialect = newDialect

      val currentElementCreation = SqldelightParserUtil.createElement
      SqldelightParserUtil.createElement = {
        when (it.elementType) {
          SqlTypes.FUNCTION_EXPR -> FunctionExprMixin(it)
          else -> currentElementCreation(it)
        }
      }
    }
  }
}


/*
 * Copyright (c) 2017 Zac Sweers
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.sweers.catchup.util

import android.os.Build

fun isM(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
fun isN(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
fun isO(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O

Add OMR1 and sdk() helper

/*
 * Copyright (c) 2017 Zac Sweers
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.sweers.catchup.util

import android.os.Build

fun isM(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
fun isN(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
fun isO(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
fun isOMR1(): Boolean = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1

inline fun sdk(level: Int, func: () -> Unit) {
  if (Build.VERSION.SDK_INT >= level) func.invoke()
}


package io.gitlab.arturbosch.detekt.api

import org.jetbrains.kotlin.psi.KtTreeVisitorVoid

/**
 * Base visitor for detekt rules.
 *
 * @author Artur Bosch
 */
open class DetektVisitor : KtTreeVisitorVoid()

Implement visit leaf psi element methods

package io.gitlab.arturbosch.detekt.api

import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.tree.LeafPsiElement
import org.jetbrains.kotlin.psi.KtTreeVisitorVoid

/**
 * Base visitor for detekt rules.
 * Adds additional rules for psi leaf elements.
 *
 * @author Artur Bosch
 */
@Suppress("EmptyFunctionBlock")
open class DetektVisitor : KtTreeVisitorVoid() {

	override fun visitElement(element: PsiElement) {
		if (element is LeafPsiElement) visitLeaf(element)
		super.visitElement(element)
	}

	open fun visitLeaf(element: LeafPsiElement) {
		when (element.text) {
			"}" -> visitLeftBrace(element)
			"{" -> visitRightBrace(element)
			":" -> visitColon(element)
		}
	}

	open fun visitColon(element: LeafPsiElement) {
	}

	open fun visitLeftBrace(element: LeafPsiElement) {
	}

	open fun visitRightBrace(element: LeafPsiElement) {
	}
}


/*
 * Copyright 2000-2015 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.intellij.plugins.hcl

import com.intellij.lang.Language

object HCLLanguage : Language("HCL") {
  override fun isCaseSensitive() = true
}

Add hcl language display name

/*
 * Copyright 2000-2015 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.intellij.plugins.hcl

import com.intellij.lang.Language

object HCLLanguage : Language("HCL") {
  override fun isCaseSensitive() = true
  override fun getDisplayName(): String {
    return "HashiCorp Configuration Language"
  }
}


package com.alexstyl.specialdates.upcoming

import com.alexstyl.specialdates.date.Date
import com.alexstyl.specialdates.date.TimePeriod
import com.alexstyl.specialdates.permissions.ContactPermissionRequest
import io.reactivex.Scheduler
import io.reactivex.disposables.Disposable
import io.reactivex.subjects.PublishSubject

internal class UpcomingEventsPresenter(private val firstDay: Date,
                                       private val permissions: ContactPermissionRequest,
                                       private val provider: IUpcomingEventsProvider,
                                       private val workScheduler: Scheduler,
                                       private val resultScheduler: Scheduler) {

    private val TRIGGER = 1
    private val subject = PublishSubject.create<Int>()
    private var disposable: Disposable? = null

    fun startPresentingInto(view: UpcomingListMVPView) {
        disposable =
                subject
                        .doOnSubscribe {
                            if (view.isEmpty) {
                                view.showLoading()
                            }
                        }
                        .observeOn(workScheduler)
                        .map { provider.calculateEventsBetween(TimePeriod.aYearFrom(firstDay)) }
                        .observeOn(resultScheduler)
                        .subscribe { upcomingRowViewModels ->
                            view.display(upcomingRowViewModels)
                        }
        if (permissions.permissionIsPresent()) {
            refreshEvents()
        } else {
            view.askForContactPermission()
        }
    }

    fun refreshEvents() {
        subject.onNext(TRIGGER)
    }

    fun stopPresenting() {
        disposable?.dispose()
    }
}

Move const to companion object

package com.alexstyl.specialdates.upcoming

import com.alexstyl.specialdates.date.Date
import com.alexstyl.specialdates.date.TimePeriod
import com.alexstyl.specialdates.permissions.ContactPermissionRequest
import io.reactivex.Scheduler
import io.reactivex.disposables.Disposable
import io.reactivex.subjects.PublishSubject

internal class UpcomingEventsPresenter(private val firstDay: Date,
                                       private val permissions: ContactPermissionRequest,
                                       private val provider: IUpcomingEventsProvider,
                                       private val workScheduler: Scheduler,
                                       private val resultScheduler: Scheduler) {

    companion object {
        private const val TRIGGER = 1
    }

    private val subject = PublishSubject.create<Int>()
    private var disposable: Disposable? = null

    fun startPresentingInto(view: UpcomingListMVPView) {
        disposable =
                subject
                        .doOnSubscribe {
                            if (view.isEmpty) {
                                view.showLoading()
                            }
                        }
                        .observeOn(workScheduler)
                        .map { provider.calculateEventsBetween(TimePeriod.aYearFrom(firstDay)) }
                        .observeOn(resultScheduler)
                        .subscribe { upcomingRowViewModels ->
                            view.display(upcomingRowViewModels)
                        }
        if (permissions.permissionIsPresent()) {
            refreshEvents()
        } else {
            view.askForContactPermission()
        }
    }

    fun refreshEvents() {
        subject.onNext(TRIGGER)
    }

    fun stopPresenting() {
        disposable?.dispose()
    }
}


package chat.rocket.android.chatroom.ui.bottomsheet.adapter

import android.view.MenuItem
import android.view.View
import chat.rocket.android.R
import chat.rocket.android.util.setVisible

/**
 * An adapter for bottomsheet menu that lists all the actions that could be taken over a chat message.
 */
class ActionListAdapter(menuItems: List<MenuItem> = emptyList(), callback: MenuItem.OnMenuItemClickListener) :
        ListBottomSheetAdapter(menuItems = menuItems, callback = callback) {

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        val item = menuItems[position]

        if (showIcons) {
            holder.imageIcon.setVisible(item.icon == null)
        } else {
            holder.imageIcon.setVisible(false)
        }

        holder.imageIcon.setImageDrawable(item.icon)
        holder.textTitle.text = item.title
        holder.itemView.setOnClickListener {
            callback?.onMenuItemClick(item)
        }
        val deleteTextColor = holder.itemView.context.resources.getColor(R.color.red)
        val color = if (item.itemId == R.id.action_menu_msg_delete) deleteTextColor else textColors.get(item.itemId)
        holder.textTitle.setTextColor(color)
    }
}

Fix showIcons logic on ActionsAdapter

package chat.rocket.android.chatroom.ui.bottomsheet.adapter

import android.view.MenuItem
import android.view.View
import chat.rocket.android.R
import chat.rocket.android.util.setVisible

/**
 * An adapter for bottomsheet menu that lists all the actions that could be taken over a chat message.
 */
class ActionListAdapter(menuItems: List<MenuItem> = emptyList(), callback: MenuItem.OnMenuItemClickListener) :
        ListBottomSheetAdapter(menuItems = menuItems, callback = callback) {

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        val item = menuItems[position]

        if (showIcons) {
            holder.imageIcon.setVisible(item.icon != null)
        } else {
            holder.imageIcon.setVisible(false)
        }

        holder.imageIcon.setImageDrawable(item.icon)
        holder.textTitle.text = item.title
        holder.itemView.setOnClickListener {
            callback?.onMenuItemClick(item)
        }
        val deleteTextColor = holder.itemView.context.resources.getColor(R.color.red)
        val color = if (item.itemId == R.id.action_menu_msg_delete) deleteTextColor else textColors.get(item.itemId)
        holder.textTitle.setTextColor(color)
    }
}


Add simple example for list based input data

package com.github.fwilhe.incell.example

import com.github.fwilhe.incell.buildFunctionOf
import com.github.fwilhe.incell.spreadsheet

fun main(args: Array<String>) {
    val expenseList = listOf(55.3, 82.1, 2.8, 9.0)
    val expenses = buildFunctionOf(expenseList)
    fun shareOfExpense(x: Int): Double = expenses(x) / expenseList.sum() * 100
    fun expenseWithTaxes(x:Int): Double = expenses(x) * 1.15

    spreadsheet {
        column("Expenses", expenses)
        column("Share of Expense", ::shareOfExpense)
        column("Cost with (fictional) tax", ::expenseWithTaxes)
    }.print(expenseList.size)
}


Create method to transform a list of LayerInterface to a list of Layer

/* Copyright 2016-present The KotlinNLP Authors. All Rights Reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, you can obtain one at http://mozilla.org/MPL/2.0/.
 * ------------------------------------------------------------------*/

package com.kotlinnlp.simplednn.core.layers

import com.kotlinnlp.simplednn.core.layers.models.recurrent.LayerContextWindow

/**
 * Build a new list of layer.
 *
 * Layers are defined as a list [x, y, z] of [LayerInterface].
 * The resulting list of [Layer] consist in input-output pairs [x-y, y-z].
 *
 * @param paramsPerLayer the parameters per layer
 * @param contextWindow the layer context window (can be null)
 *
 * @return list of layers where the output of a layer is the reference of the input of the next one
 */
fun List<LayerInterface>.toLayers(paramsPerLayer: List<LayerParameters<*>>,
                                  contextWindow: LayerContextWindow? = null): List<Layer<*>> {

  require(this.subList(1, this.size).all { it.type == LayerType.Input.Dense }) {
    "The last layers must be dense."
  }

  require(this.subList(2, this.size).all { it.connectionType!!.property != LayerType.Property.Merge }) {
    "Only the first layer can be a Merge layer."
  }

  var prevLayer: Layer<*>? = null

  return List(
    size = this.size - 1,
    init = { i ->

      val layer: Layer<*> = if (i == 0)
        LayerFactory(
          inputConfiguration = this[0],
          outputConfiguration = this[1],
          params = paramsPerLayer[0],
          contextWindow = contextWindow
        )
      else
        LayerFactory(
          inputArrays = listOf(prevLayer!!.outputArray),
          outputConfiguration = this[i + 1],
          params = paramsPerLayer[i],
          dropout = this[i].dropout,
          contextWindow = contextWindow
        )

      prevLayer = layer

      layer
    }
  )
}


package views

import models.Image
import models.Thumbnail
import views.BaseView.baseUrl
import views.BaseView.uriEncode

/**
 * Created by allen on 3/30/17.
 */

object ImageView{
    fun urlForImageFull(image: Image?): String{
        if(image != null){
            return "http://photog.alaska.dev/media/images/" + uriEncode(image.path)
        }
        return ""
    }

    fun urlForThumbnailMini(thumbnail: Thumbnail?): String{
        if(thumbnail != null){
            return "http://photog.alaska.dev/media/thumbnails/" + uriEncode(thumbnail.miniThumbnailPath)
        }
        return ""
    }

    fun urlForThumbnail(thumbnail: Thumbnail?): String{
        if(thumbnail != null){
            return "http://photog.alaska.dev/media/thumbnails/" + uriEncode(thumbnail.thumbnailPath)
        }
        return ""
    }

    fun urlForImage(image: Image?): String{
        if(image != null){
            return  baseUrl() + "images/" + image.id
        }
        return ""
    }
}

Refactor thumbnail and photo asset urls to use constants

package views

import models.Image
import models.Thumbnail
import views.BaseView.baseUrl
import views.BaseView.uriEncode

/**
 * Created by allen on 3/30/17.
 */

object ImageView{
    val ASSET_IMAGE_BASE_URL: String = "http://photog.alaska.dev/media/images/"
    val ASSET_THUMBNAIL_BASE_URL: String = "http://photog.alaska.dev/media/thumbnails/"

    fun urlForImageFull(image: Image?): String{
        if(image != null){
            return ASSET_IMAGE_BASE_URL + uriEncode(image.path)
        }
        return ""
    }

    fun urlForThumbnailMini(thumbnail: Thumbnail?): String{
        if(thumbnail != null){
            return ASSET_THUMBNAIL_BASE_URL + uriEncode(thumbnail.miniThumbnailPath)
        }
        return ""
    }

    fun urlForThumbnail(thumbnail: Thumbnail?): String{
        if(thumbnail != null){
            return ASSET_THUMBNAIL_BASE_URL + uriEncode(thumbnail.thumbnailPath)
        }
        return ""
    }

    fun urlForImage(image: Image?): String{
        if(image != null){
            return  baseUrl() + "images/" + image.id
        }
        return ""
    }
}


import org.gradle.gradlebuild.unittestandcompile.ModuleType

plugins {
    gradlebuild.classycle
    `kotlin-library`
}

dependencies {
    testFixturesApi(project(":internalIntegTesting"))
    testImplementation(project(":kotlinDslTestFixtures"))
}

gradlebuildJava {
    moduleType = ModuleType.INTERNAL
}

testFixtures {
    from(":core")
}

tasks.matching { it.name in listOf("integTest", "java9IntegTest") }.configureEach {
    require(this is Test)
    options {
        require(this is JUnitOptions)
        excludeCategories("org.gradle.soak.categories.SoakTest")
    }
}

tasks.register("soakTest", org.gradle.gradlebuild.test.integrationtests.SoakTest::class) {
    val integTestSourceSet = sourceSets.integTest.get()
    testClassesDirs = integTestSourceSet.output.classesDirs
    classpath = integTestSourceSet.runtimeClasspath
    systemProperty("org.gradle.soaktest", "true")
    options {
        require(this is JUnitOptions)
        includeCategories("org.gradle.soak.categories.SoakTest")
    }
}

Exclude `META-INF/*.kotlin_module` from `classycle` checks in `soak`

import org.gradle.gradlebuild.unittestandcompile.ModuleType

plugins {
    gradlebuild.classycle
    `kotlin-library`
}

dependencies {
    testFixturesApi(project(":internalIntegTesting"))
    testImplementation(project(":kotlinDslTestFixtures"))
}

gradlebuildJava {
    moduleType = ModuleType.INTERNAL
}

testFixtures {
    from(":core")
}

tasks.matching { it.name in listOf("integTest", "java9IntegTest") }.configureEach {
    require(this is Test)
    options {
        require(this is JUnitOptions)
        excludeCategories("org.gradle.soak.categories.SoakTest")
    }
}

tasks.register("soakTest", org.gradle.gradlebuild.test.integrationtests.SoakTest::class) {
    val integTestSourceSet = sourceSets.integTest.get()
    testClassesDirs = integTestSourceSet.output.classesDirs
    classpath = integTestSourceSet.runtimeClasspath
    systemProperty("org.gradle.soaktest", "true")
    options {
        require(this is JUnitOptions)
        includeCategories("org.gradle.soak.categories.SoakTest")
    }
}

classycle {
    excludePatterns.set(listOf("META-INF/*.kotlin_module"))
}


package info.nightscout.androidaps.utils.buildHelper

import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.Config
import info.nightscout.androidaps.plugins.general.maintenance.LoggerUtils
import java.io.File
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class BuildHelper @Inject constructor(private val config: Config) {

    private var devBranch = false
    private var engineeringMode = false

    init {
        val extFilesDir = LoggerUtils.getLogDirectory()
        val engineeringModeSemaphore = File(extFilesDir, "engineering_mode")

        engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile
        devBranch = BuildConfig.VERSION.contains("-") || BuildConfig.VERSION.matches(Regex(".*[a-zA-Z]+.*"))
    }

    fun isEngineeringModeOrRelease(): Boolean =
        if (!config.APS) true else engineeringMode || !devBranch

    fun isEngineeringMode(): Boolean =
        if (!config.APS) true else engineeringMode || !devBranch

    fun isDev(): Boolean = devBranch
}

Make enginering mode enabled only when turned on

package info.nightscout.androidaps.utils.buildHelper

import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.Config
import info.nightscout.androidaps.plugins.general.maintenance.LoggerUtils
import java.io.File
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class BuildHelper @Inject constructor(private val config: Config) {

    private var devBranch = false
    private var engineeringMode = false

    init {
        val extFilesDir = LoggerUtils.getLogDirectory()
        val engineeringModeSemaphore = File(extFilesDir, "engineering_mode")

        engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile
        devBranch = BuildConfig.VERSION.contains("-") || BuildConfig.VERSION.matches(Regex(".*[a-zA-Z]+.*"))
    }

    fun isEngineeringModeOrRelease(): Boolean =
        if (!config.APS) true else engineeringMode || !devBranch

    fun isEngineeringMode(): Boolean =
        engineeringMode

    fun isDev(): Boolean = devBranch
}


package org.spek.junit.api

import org.spek.impl.*
import org.spek.junit.impl.*
import org.junit.runner.RunWith
import org.junit.Test as test

RunWith(javaClass<SpekJUnitClassRunner<*>>())
public abstract class JUnitSpek: SpekImpl() {

    //possible workaround to cheat JUnit integration
    test public fun mockTest() {
    }
}

Update kotlin to correctly report attributes to JUnit integration

package org.spek.junit.api

import org.spek.impl.*
import org.spek.junit.impl.*
import org.junit.runner.RunWith
import org.junit.Test as test

RunWith(javaClass<SpekJUnitClassRunner<*>>())
public abstract class JUnitSpek: SpekImpl() {}


/*
 * Copyright 2000-2016 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.ui

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.wm.IdeFrame

/**
 * @author Alexander Lobas
 */

abstract class NotificationAction : AnAction() {
  override fun update(e: AnActionEvent) {
    val layout = getBalloonLayout(e)
    e.presentation.isEnabled = layout != null && layout.balloonCount > 0
  }

  protected fun getBalloonLayout(e: AnActionEvent) = e.getData(IdeFrame.KEY)?.balloonLayout as BalloonLayoutImpl?
}

class CloseFirstNotificationAction : NotificationAction() {
  override fun actionPerformed(e: AnActionEvent) {
    getBalloonLayout(e)?.closeFirst()
  }
}

class CloseAllNotificationsAction : NotificationAction() {
  override fun actionPerformed(e: AnActionEvent) {
    getBalloonLayout(e)?.closeAll()
  }
}

Rename one of NotificationAction classes to avoid confusion with another

/*
 * Copyright 2000-2016 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.ui

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.wm.IdeFrame

abstract class CloseNotificationAction : AnAction() {
  override fun update(e: AnActionEvent) {
    val layout = getBalloonLayout(e)
    e.presentation.isEnabled = layout != null && layout.balloonCount > 0
  }

  protected fun getBalloonLayout(e: AnActionEvent) = e.getData(IdeFrame.KEY)?.balloonLayout as BalloonLayoutImpl?
}

class CloseFirstNotificationAction : CloseNotificationAction() {
  override fun actionPerformed(e: AnActionEvent) {
    getBalloonLayout(e)?.closeFirst()
  }
}

class CloseAllNotificationsAction : CloseNotificationAction() {
  override fun actionPerformed(e: AnActionEvent) {
    getBalloonLayout(e)?.closeAll()
  }
}


Test multi-repo update to update only roots which need it

/*
 * Copyright 2000-2017 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package git4idea.update

import com.intellij.openapi.progress.EmptyProgressIndicator
import com.intellij.openapi.vcs.Executor.cd
import com.intellij.openapi.vcs.update.UpdatedFiles
import git4idea.config.UpdateMethod
import git4idea.repo.GitRepository
import git4idea.test.git
import git4idea.test.last
import git4idea.test.tacp
import java.io.File

class GitMultiRepoUpdateTest : GitUpdateBaseTest() {

  private lateinit var repository: GitRepository
  private lateinit var community: GitRepository
  private lateinit var bro: File
  private lateinit var bromunity: File

  override fun setUp() {
    super.setUp()

    val mainRepo = setupRepositories(myProjectPath, "parent", "bro")
    repository = mainRepo.projectRepo
    bro = mainRepo.bro

    val communityDir = File(myProjectPath, "community")
    assertTrue(communityDir.mkdir())
    val enclosingRepo = setupRepositories(communityDir.path, "community_parent", "community_bro")
    community = enclosingRepo.projectRepo
    bromunity = enclosingRepo.bro

    repository.update()
    community.update()
  }

  fun `test update only roots with incoming changes`() {
    cd(bro)
    tacp("file")
    val hash = last()

    val updatedRepos = mutableListOf<GitRepository>()
    myGit.mergeListener = {
      updatedRepos.add(it)
    }

    updateWithMerge()

    assertTrue("Main repository should have been updated", updatedRepos.contains(repository))
    assertFalse("Nested repository shouldn't be updated", updatedRepos.contains(community))
    assertEquals("Couldn't find the hash from bro", hash, git("log -1 --no-merges --pretty=%H"))
  }

  private fun updateWithMerge(): GitUpdateResult {
    return GitUpdateProcess(myProject, EmptyProgressIndicator(), repositories(), UpdatedFiles.create(), false).update(UpdateMethod.MERGE)
  }

  private fun repositories() = listOf(repository, community)
}


/*
 * Copyright 2000-2017 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.intellij.stats.personalization.impl

import com.intellij.openapi.components.ProjectComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage

/**
 * @author Vitaliy.Bibaev
 */
@State(name = "ProjectUserFactors", storages = arrayOf(Storage("completion.factors.user.xml")))
class ProjectUserFactorStorage : ProjectComponent, UserFactorStorageBase()

Save the project factors storage info workspace file

/*
 * Copyright 2000-2017 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.intellij.stats.personalization.impl

import com.intellij.openapi.components.ProjectComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.components.StoragePathMacros

/**
 * @author Vitaliy.Bibaev
 */
@State(name = "ProjectUserFactors", storages = arrayOf(Storage(StoragePathMacros.WORKSPACE_FILE)))
class ProjectUserFactorStorage : ProjectComponent, UserFactorStorageBase()


package _Self

object Constants {
  const val DEFAULT_CHANNEL = "default"
  const val EAP_CHANNEL = "eap"
  const val DEV_CHANNEL = "Dev"

  const val VERSION = "1.10.3"
  const val DEV_VERSION = "1.11.0"

  const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT"
  const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT"
  const val PROPERTY_TESTS = "LATEST-EAP-SNAPSHOT"
  const val LONG_RUNNING_TESTS = "LATEST-EAP-SNAPSHOT"
  const val QODANA_TESTS = "LATEST-EAP-SNAPSHOT"
  const val RELEASE = "2021.3"
  const val RELEASE_DEV = "LATEST-EAP-SNAPSHOT"
  const val RELEASE_EAP = "LATEST-EAP-SNAPSHOT"
}

Update build version of IJ

package _Self

object Constants {
  const val DEFAULT_CHANNEL = "default"
  const val EAP_CHANNEL = "eap"
  const val DEV_CHANNEL = "Dev"

  const val VERSION = "1.10.3"
  const val DEV_VERSION = "1.11.0"

  const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT"
  const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT"
  const val PROPERTY_TESTS = "LATEST-EAP-SNAPSHOT"
  const val LONG_RUNNING_TESTS = "LATEST-EAP-SNAPSHOT"
  const val QODANA_TESTS = "LATEST-EAP-SNAPSHOT"
  const val RELEASE = "2022.1.3"

  // Use LATEST-EAP-SNAPSHOT only when we'll update the minimum version of IJ to 222+
  // Because of some API inconcistincies, IdeaVim built on 2022+ won't run on older versions of IJ
  const val RELEASE_DEV = "2022.1.3"
  const val RELEASE_EAP = "2022.1.3"
}


require shared-mime-info.inc

DEPENDS = "libxml2 intltool-native glib-2.0 shared-mime-info-native"
PR = "r2"

do_install_append() {
    update-mime-database ${D}${datadir}/mime
}

# freedesktop.org.xml is huge and only needed when updating the db
# mime.bbclass will add the dependency on it automagically
PACKAGES =+ "freedesktop-mime-info"
FILES_freedesktop-mime-info = "${datadir}/mime/packages/freedesktop.org.xml"
RDEPENDS_freedesktop-mime-info = "shared-mime-info"

SRC_URI[md5sum] = "01d72161f7d88123fbccd378871f02f0"
SRC_URI[sha256sum] = "1c247e03418d6b90bcbc0da6c1abe6ac9cd5bacf9c3a2f3b6105376cf7b0eed8"

Update LICENSE field version to GPLv2

require shared-mime-info.inc

LICENSE = "GPLv2"

DEPENDS = "libxml2 intltool-native glib-2.0 shared-mime-info-native"
PR = "r3"

do_install_append() {
    update-mime-database ${D}${datadir}/mime
}

# freedesktop.org.xml is huge and only needed when updating the db
# mime.bbclass will add the dependency on it automagically
PACKAGES =+ "freedesktop-mime-info"
FILES_freedesktop-mime-info = "${datadir}/mime/packages/freedesktop.org.xml"
RDEPENDS_freedesktop-mime-info = "shared-mime-info"

SRC_URI[md5sum] = "01d72161f7d88123fbccd378871f02f0"
SRC_URI[sha256sum] = "1c247e03418d6b90bcbc0da6c1abe6ac9cd5bacf9c3a2f3b6105376cf7b0eed8"


DESCRIPTION = "Linux kernel, debug build, based on nilrt branch"

require linux-nilrt.inc
require linux-nilrt-squashfs.inc

NI_RELEASE_VERSION = "comms-2.0"
LINUX_VERSION = "3.14"
LINUX_VERSION_EXTENSION = "-nilrt-debug"
KBRANCH = "nilrt/${NI_RELEASE_VERSION}/${LINUX_VERSION}"

KERNEL_MODULES_META_PACKAGE = "kernel-modules-debug"
KERNEL_MODULE_PACKAGE_NAME_PREPEND = "kernel-module-debug"
KERNEL_MODULE_PACKAGE_PREPEND = "${KERNEL_MODULE_PACKAGE_NAME_PREPEND}-%s"

# Force creation of symlink to target file at a relative path
KERNEL_IMAGE_SYMLINK_DEST = "."

# Remove unecessary packages (kernel-vmlinux, kernel-dev) for optional kernel
PACKAGES = "kernel kernel-base kernel-image ${KERNEL_MODULES_META_PACKAGE}"
PKG_kernel = "kernel-debug"

# Remove kernel firmware package (refer to kernel.bbclass)
PACKAGESPLITFUNCS_remove = "split_kernel_packages"

# Subfolder of the same name will be added to FILESEXTRAPATHS and also
# used for nilrt-specific config fragment manipulation during build.
# Provide a unique name for each recipe saved in the same source folder.
KBUILD_FRAGMENTS_LOCATION := "nilrt-debug"

SRC_URI += "file://debug.cfg \
           "

Clean up debug kernel recipe

DESCRIPTION = "Linux kernel, debug build, based on nilrt branch"

require linux-nilrt.inc

NI_RELEASE_VERSION = "comms-2.0"
LINUX_VERSION = "3.14"
LINUX_VERSION_EXTENSION = "-nilrt-debug"
KBRANCH = "nilrt/${NI_RELEASE_VERSION}/${LINUX_VERSION}"

KERNEL_MODULES_META_PACKAGE = "kernel-modules-debug"
KERNEL_MODULE_PACKAGE_NAME_PREPEND = "kernel-module-debug"
KERNEL_MODULE_PACKAGE_PREPEND = "${KERNEL_MODULE_PACKAGE_NAME_PREPEND}-%s"

# Rename packages to avoid collision with stock kernel package names
PKG_kernel = "kernel-debug"
PKG_kernel-dev = "kernel-dev-debug"
PKG_kernel-vmlinux = "kernel-vmlinux-debug"

# Remove kernel firmware package (refer to kernel.bbclass)
PACKAGESPLITFUNCS_remove = "split_kernel_packages"

# Subfolder of the same name will be added to FILESEXTRAPATHS and also
# used for nilrt-specific config fragment manipulation during build.
# Provide a unique name for each recipe saved in the same source folder.
KBUILD_FRAGMENTS_LOCATION := "nilrt-debug"

SRC_URI += "file://debug.cfg \
           "


require linux.inc

DESCRIPTION = "Linux kernel for OMAP processors"
KERNEL_IMAGETYPE = "uImage"

COMPATIBLE_MACHINE = "overo"

BOOT_SPLASH ?= "logo_linux_clut224-generic.ppm"
PV = "3.2"

S = "${WORKDIR}/git"

SRCREV = "${AUTOREV}"
SRC_URI = "git://www.sakoman.com/git/linux-omap-2.6.git;branch=omap-3.2;protocol=git \
	   file://defconfig \
           file://${BOOT_SPLASH} \
           "

Use latest kernel from sakoman repo

require linux.inc

DESCRIPTION = "Linux kernel for OMAP processors"
KERNEL_IMAGETYPE = "uImage"

COMPATIBLE_MACHINE = "overo"

BOOT_SPLASH ?= "logo_linux_clut224-generic.ppm"
PV = "3.2"

S = "${WORKDIR}/git"

SRCREV = "${AUTOREV}"
#SRCREV = "33128932803c3f8c35fe8dae257901deb60db2aa"
SRC_URI = "git://www.sakoman.com/git/linux-omap-2.6.git;branch=omap-3.2;protocol=git \
	   file://defconfig \
           file://${BOOT_SPLASH} \
           "


DESCRIPTION = "A small image just capable of allowing a device to boot."

IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL} libusb1 mochad "

IMAGE_LINGUAS = " "

LICENSE = "MIT"

inherit core-image

IMAGE_ROOTFS_SIZE = "8192"

Fix Image Creation issue : Increase Rootfs Size

DESCRIPTION = "A small image just capable of allowing a device to boot."

IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL} libusb1 mochad "

IMAGE_LINGUAS = " "

LICENSE = "MIT"

inherit core-image

IMAGE_ROOTFS_SIZE = "16384"


require u-boot-ti.inc

PR = "r29"

BRANCH = "ti-u-boot-2020.01"

SRCREV = "df5e46d817182dcbd52212a7ff3c31eb20398dbe"

Update to the latest commit

require u-boot-ti.inc

PR = "r30"

BRANCH = "ti-u-boot-2020.01"

SRCREV = "84b608fd3489c8dd93d8eb20e7f005d967b88402"


DESCRIPTION = "Utilities to collect and visualise system statistics"
HOMEPAGE = "http://www.i-scream.org/libstatgrab/"

LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

DEPENDS = "ncurses"

PV = "0.91"

FILESEXTRAPATHS_prepend := "${THISDIR}/patches:"

SRCREV = "c39988855a9d1eb54adadb899b3865304da2cf84"
SRC_URI = "git://github.com/i-scream/libstatgrab.git \
           file://linux-proctbl-names-with-spaces.patch \
          "

S = "${WORKDIR}/git"

inherit autotools pkgconfig

# libstatgrab-client need the .so present to work :(
FILES_${PN} += "${libdir}/*.so"
INSANE_SKIP_${PN} = "dev-so"

Fix for fido, be more clear regarding configure options

DESCRIPTION = "Utilities to collect and visualise system statistics"
HOMEPAGE = "http://www.i-scream.org/libstatgrab/"

LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

DEPENDS = "ncurses"

PV = "0.91"

FILESEXTRAPATHS_prepend := "${THISDIR}/patches:"

SRCREV = "c39988855a9d1eb54adadb899b3865304da2cf84"
SRC_URI = "git://github.com/i-scream/libstatgrab.git \
           file://linux-proctbl-names-with-spaces.patch \
          "

EXTRA_OECONF = "--without-perl5 --with-mnttab=/proc/mounts"

S = "${WORKDIR}/git"

inherit autotools pkgconfig

# libstatgrab-client need the .so present to work :(
FILES_${PN} += "${libdir}/*.so"
INSANE_SKIP_${PN} = "dev-so"


SUMMARY = "Window navigation construction toolkit"
LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"

BPN = "libwnck"

SECTION = "x11/libs"
DEPENDS = "intltool-native gtk+3 gdk-pixbuf-native libxres"

PACKAGECONFIG ??= "startup-notification"
PACKAGECONFIG[startup-notification] = "--enable-startup-notification,--disable-startup-notification,startup-notification"

inherit gnomebase gobject-introspection gtk-doc
SRC_URI[archive.md5sum] = "487938d65d4bfae1f2501052b1bd7492"
SRC_URI[archive.sha256sum] = "1cb03716bc477058dfdf3ebfa4f534de3b13b1aa067fcd064d0b7813291cba72"

inherit distro_features_check
# libxres means x11 only
REQUIRED_DISTRO_FEATURES = "x11"

Add missing dependency on gnome-common-native

SUMMARY = "Window navigation construction toolkit"
LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"

BPN = "libwnck"

SECTION = "x11/libs"
DEPENDS = "intltool-native gnome-common-native gtk+3 gdk-pixbuf-native libxres"

PACKAGECONFIG ??= "startup-notification"
PACKAGECONFIG[startup-notification] = "--enable-startup-notification,--disable-startup-notification,startup-notification"

inherit gnomebase gobject-introspection gtk-doc
SRC_URI[archive.md5sum] = "487938d65d4bfae1f2501052b1bd7492"
SRC_URI[archive.sha256sum] = "1cb03716bc477058dfdf3ebfa4f534de3b13b1aa067fcd064d0b7813291cba72"

inherit distro_features_check
# libxres means x11 only
REQUIRED_DISTRO_FEATURES = "x11"


LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

inherit autotools gtk-doc

DEPENDS = "raptor"
RDEPENDS_${PN} = "raptor"

SRC_URI = "git://github.com/dajobe/rasqal.git;branch=master \
	   file://No-docs-and-NOCONFIGURE.patch \
	   file://Fix-cross-compile.patch \
	  "

SRCREV = "ffc5f88dcaa20b279a39b537db1c65019003b16d"

PV = "0.9.27+git${SRCPV}"

S = "${WORKDIR}/git"

EXTRA_OECONF = "\
		--enable-maintainer-mode \
		--disable-gtk-doc \
		--with-regex-library=posix \
		--with-decimal=gmp \
	       "

# Rasqal autogen.sh does not work properly, so let OE do the job
do_configure() {
	cd ${S}
	export NOCONFIGURE="no"; ./autogen.sh
	oe_runconf
}

Fix race conditions with PARALLEL_MAKE = ""

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

inherit autotools gtk-doc

DEPENDS = "raptor"
RDEPENDS_${PN} = "raptor"

SRC_URI = "git://github.com/dajobe/rasqal.git;branch=master \
	   file://No-docs-and-NOCONFIGURE.patch \
	   file://Fix-cross-compile.patch \
	  "

SRCREV = "ffc5f88dcaa20b279a39b537db1c65019003b16d"

PV = "0.9.27+git${SRCPV}"

S = "${WORKDIR}/git"

EXTRA_OECONF = "\
		--enable-maintainer-mode \
		--disable-gtk-doc \
		--with-regex-library=posix \
		--with-decimal=gmp \
	       "

# Rasqal autogen.sh does not work properly, so let OE do the job
do_configure() {
	cd ${S}
	export NOCONFIGURE="no"; ./autogen.sh
	oe_runconf
}
PARALLEL_MAKE = ""


DESCRIPTION = "Assassin Packages Thumbnails"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
LICENSE = "GPL"
RDEPENDS = "assassin"
PV = "0.1+svnr${SRCPV}"
PR = "r1"

SRC_URI = "svn://svn.openmoko.org/trunk/src/target/thumbnails/;module=result;proto=https"

do_install() {
        install -d ${D}${THUMBNAIL_DIR}
        cp -f ${WORKDIR}/result/${THUMBNAIL_FN} ${D}${THUMBNAIL_DIR}
}

FILES_${PN} = "${THUMBNAIL_DIR}/${THUMBNAIL_FN}"

THUMBNAIL_DIR = "${datadir}/assassin/"
THUMBNAIL_FN = "thumbnail.eet"

Revert "[alias name] Adding alias name tags for packages"

DESCRIPTION = "Assassin Packages Thumbnails"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
PKG_TAGS_${PN} = "group::unknown"
LICENSE = "GPL"
RDEPENDS = "assassin"
PV = "0.1+svnr${SRCPV}"
PR = "r0"

SRC_URI = "svn://svn.openmoko.org/trunk/src/target/thumbnails/;module=result;proto=https"

do_install() {
        install -d ${D}${THUMBNAIL_DIR}
        cp -f ${WORKDIR}/result/${THUMBNAIL_FN} ${D}${THUMBNAIL_DIR}
}

FILES_${PN} = "${THUMBNAIL_DIR}/${THUMBNAIL_FN}"

THUMBNAIL_DIR = "${datadir}/assassin/"
THUMBNAIL_FN = "thumbnail.eet"


SUMMARY = "AGL SOTA Package Group"
DESCRIPTION = "A set of packages belong to GENIVI SOTA Project and OSTree"

LICENSE = "MIT"

inherit packagegroup

PACKAGES = " packagegroup-agl-sota "

ALLOW_EMPTY_${PN} = "1"

RDEPENDS_${PN} += "\
    rvi-sota-client \
    ostree \
"

Add ota-plus client and provisioning recipe to image

SUMMARY = "AGL SOTA Package Group"
DESCRIPTION = "A set of packages belong to GENIVI SOTA Project and OSTree"

LICENSE = "MIT"

inherit packagegroup

PACKAGES = " packagegroup-agl-sota "

ALLOW_EMPTY_${PN} = "1"

RDEPENDS_${PN} += "\
    ota-plus-client \
    ota-plus-demo-provision \
    ostree \
"


SUMMARY = "IoT Reference OS Kit image for Industrial profile."
DESCRIPTION = "IoT Reference OS Kit image for Industrial profile."

REFKIT_IMAGE_INDUSTRIAL_EXTRA_FEATURES ?= "${REFKIT_IMAGE_FEATURES_COMMON}"
REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL ?= "${REFKIT_IMAGE_INSTALL_COMMON}"
REFKIT_IMAGE_EXTRA_FEATURES += "${REFKIT_IMAGE_INDUSTRIAL_EXTRA_FEATURES}"
REFKIT_IMAGE_EXTRA_INSTALL += "${REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL}"

REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL_append = " packagegroup-industrial-robotics"

# Example for customization in local.conf when building
# refkit-image-industrial.bb:
# IMAGE_BASENAME_pn-refkit-image-industrial = "my-refkit-image-reference"
# REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL_append = "my-own-package"
# REFKIT_IMAGE_INDUSTRIAL_EXTRA_FEATURES_append = "dev-pkgs"

# inherit refkit-image

# Currently ROS (genmsg in particular) does not build if usrmerge is
# enabled. As a horrendous kludge, we only inherit refkit-image if
# usrmerge is not among DISTRO_FEATURES, thus letting this image de-
# generate to a NOP if usrmerge is enabled.
#
# Note that we need to also replicate the LICENSE-setting here in
# case refkit-image does not get inherited, otherwise the bitbake
# recipe-parser bails out.

LICENSE = "MIT"
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', \
              '', 'refkit-image', d)}

Revert "rekit-image-industrial.bb: horrendous kludge to avoid usrmerge conflict."

SUMMARY = "IoT Reference OS Kit image for Industrial profile."
DESCRIPTION = "IoT Reference OS Kit image for Industrial profile."

REFKIT_IMAGE_INDUSTRIAL_EXTRA_FEATURES ?= "${REFKIT_IMAGE_FEATURES_COMMON}"
REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL ?= "${REFKIT_IMAGE_INSTALL_COMMON}"
REFKIT_IMAGE_EXTRA_FEATURES += "${REFKIT_IMAGE_INDUSTRIAL_EXTRA_FEATURES}"
REFKIT_IMAGE_EXTRA_INSTALL += "${REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL}"

REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL_append = " packagegroup-industrial-robotics"

# Example for customization in local.conf when building
# refkit-image-industrial.bb:
# IMAGE_BASENAME_pn-refkit-image-industrial = "my-refkit-image-reference"
# REFKIT_IMAGE_INDUSTRIAL_EXTRA_INSTALL_append = "my-own-package"
# REFKIT_IMAGE_INDUSTRIAL_EXTRA_FEATURES_append = "dev-pkgs"

inherit refkit-image


DESCRIPTION = "ARM Benchmarks"
HOMEPAGE = "https://gforge.ti.com/gf/project/am_benchmarks/"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=7aefb5e1cffc7b6a3ef18b803f957922"
SECTION = "system"

PR = "r3"

BRANCH ?= "master"
SRCREV = "e9fbf7990e93d97e7471e509626969d244cca214"

SRC_URI = "git://gitorious.org/arm_benchmarks/arm_benchmarks.git;protocol=git;branch=${BRANCH}"

S = "${WORKDIR}/git"

PLATFORM_ARCH = "${ARMPKGARCH}"
# Use ARCH format expected by the makefile
PLATFORM_ARCH_omapl138 = "armv5te"

do_compile() {
	export CROSS_COMPILE=${TARGET_PREFIX}
	# build the release version
	make ARCH=${PLATFORM_ARCH} release
}

do_install() {
	make ARCH=${PLATFORM_ARCH} DESTDIR=${D} install
}

Move makefiles into ARCH directory

DESCRIPTION = "ARM Benchmarks"
HOMEPAGE = "https://gforge.ti.com/gf/project/am_benchmarks/"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=7aefb5e1cffc7b6a3ef18b803f957922"
SECTION = "system"

PR = "r4"

BRANCH ?= "master"
SRCREV = "9b7b4fbde8fcf796a23da2a464dbf934e550f6c9"

SRC_URI = "git://gitorious.org/arm_benchmarks/arm_benchmarks.git;protocol=git;branch=${BRANCH}"

S = "${WORKDIR}/git"

PLATFORM_ARCH = "${ARMPKGARCH}"
PLATFORM_ARCH_omapl138 = "armv5te"

do_compile() {
	export CROSS_COMPILE=${TARGET_PREFIX}
	# build the release version
	oe_runmake -C ${PLATFORM_ARCH} release
}

do_install() {
	oe_runmake -C ${PLATFORM_ARCH} DESTDIR=${D} install
}


SECTION = "devel"
require binutils_${PV}.bb
inherit canadian-sdk

DEPENDS="\
	virtual/${HOST_PREFIX}binutils \
	virtual/${HOST_PREFIX}gcc \
	flex-native bison-native \
"

FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-${PV}"
EXTRA_OECONF = "--with-sysroot=${prefix}/${TARGET_SYS} \
		--program-prefix=${TARGET_PREFIX}"
PR = "r3"

FILES_${PN}-dbg += "${prefix}/${TARGET_SYS}/bin/.debug"

do_stage() {
	:
}

do_install () {
        autotools_do_install

        # Install the libiberty header
        install -d ${D}${includedir}
        install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
        install -m 644 ${S}/include/libiberty.h ${D}${includedir}
}

Use add SYSROOT, use SDK_REALPATH_MINGW, bump PR

SECTION = "devel"
require binutils_${PV}.bb
inherit canadian-sdk

DEPENDS="\
	virtual/${HOST_PREFIX}binutils \
	virtual/${HOST_PREFIX}gcc \
	flex-native bison-native \
"

FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-${PV}"
# On MinGW hosts we want to prepend a drive letter, in ${SDK_REALPATH_MINGW}
# to the sysroot path.
SYSROOT = "${@['${SDK_REALPATH}/${TARGET_SYS}', '${SDK_REALPATH_MINGW}${SDK_REALPATH}/${TARGET_SYS}'][bb.data.getVar('SDK_OS', d, 1) in ['mingw32', 'mingw64']]}"
EXTRA_OECONF = "--with-sysroot=${SYSROOT} \
		--program-prefix=${TARGET_PREFIX}"
PR = "r4"

FILES_${PN}-dbg += "${prefix}/${TARGET_SYS}/bin/.debug"

do_stage() {
	:
}

do_install () {
        autotools_do_install

        # Install the libiberty header
        install -d ${D}${includedir}
        install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
        install -m 644 ${S}/include/libiberty.h ${D}${includedir}
}


SUMMARY = "Set of CLI tools for Openlmi providers"
DESCRIPTION = "openlmi-tools is a set of command line tools for Openlmi providers."
HOMEPAGE = "http://www.openlmi.org/"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=75859989545e37968a99b631ef42722e"
SECTION = "System/Management"

inherit setuptools

DEPENDS = "python-native python-pywbem-native python-m2crypto python-pywbem"

SRC_URI = "http://fedorahosted.org/released/${BPN}/${BP}.tar.gz \
          "
SRC_URI[md5sum] = "e156246cb7b49753db82f4ddf7f03e50"
SRC_URI[sha256sum] = "292b8f5f2250655a4add8183c529b73358bc980bd4f23cfa484a940953fce9e4"

do_compile_prepend() {
    cd cli
    sed 's/@@VERSION@@/$(VERSION)/g' setup.py.skel >setup.py
}
do_install_prepend() {
    cd cli
}

python() {
    if 'meta-python' not in d.getVar('BBFILE_COLLECTIONS').split():
        raise bb.parse.SkipRecipe('Requires meta-python to be present.')
}

Fix setup.py clean during build

SUMMARY = "Set of CLI tools for Openlmi providers"
DESCRIPTION = "openlmi-tools is a set of command line tools for Openlmi providers."
HOMEPAGE = "http://www.openlmi.org/"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://../COPYING;md5=75859989545e37968a99b631ef42722e"
SECTION = "System/Management"

inherit setuptools

DEPENDS = "python-native python-pywbem-native python-m2crypto python-pywbem"

SRC_URI = "http://fedorahosted.org/released/${BPN}/${BP}.tar.gz \
          "
SRC_URI[md5sum] = "e156246cb7b49753db82f4ddf7f03e50"
SRC_URI[sha256sum] = "292b8f5f2250655a4add8183c529b73358bc980bd4f23cfa484a940953fce9e4"

S = "${WORKDIR}/${BP}/cli"

do_configure_prepend() {
    sed 's/@@VERSION@@/$(VERSION)/g' setup.py.skel >setup.py
}

python() {
    if 'meta-python' not in d.getVar('BBFILE_COLLECTIONS').split():
        raise bb.parse.SkipRecipe('Requires meta-python to be present.')
}


include gpe-contacts.inc

PR="r1"
SRC_URI = "${GPE_MIRROR}/gpe-contacts-${PV}.tar.bz2"

DEPENDS += "gtk+-2.6.4-1.osso7 libgpepimc-hildon libosso hildon-lgpl"

EXTRA_OECONF += "--enable-hildon"

S = "${WORKDIR}/gpe-contacts-${PV}"

Change RDEPENDS to make sure gpe-contacts-hildon doesn't pull in gpe-icons.

include gpe-contacts.inc

PR="r2"
SRC_URI = "${GPE_MIRROR}/gpe-contacts-${PV}.tar.bz2"

DEPENDS += "gtk+-2.6.4-1.osso7 libgpepimc-hildon libosso hildon-lgpl"
RDEPENDS = ""

EXTRA_OECONF += "--enable-hildon"

S = "${WORKDIR}/gpe-contacts-${PV}"


DESCRIPTION = "NILRT linux kernel debug build"
NI_RELEASE_VERSION = "master"
LINUX_VERSION = "5.10"
LINUX_VERSION_xilinx-zynq = "4.14"
LINUX_KERNEL_TYPE = "debug"

require linux-nilrt-alternate.inc

SRC_URI += "\
	file://debug.cfg \
"

# This is the place to overwrite the source AUTOREV from linux-nilrt.inc, if
# the kernel recipe requires a particular ref.
#SRCREV = ""

Move debug vmlinux out of /boot

DESCRIPTION = "NILRT linux kernel debug build"
NI_RELEASE_VERSION = "master"
LINUX_VERSION = "5.10"
LINUX_VERSION_xilinx-zynq = "4.14"
LINUX_KERNEL_TYPE = "debug"

require linux-nilrt-alternate.inc

SRC_URI += "\
	file://debug.cfg \
"

# This is the place to overwrite the source AUTOREV from linux-nilrt.inc, if
# the kernel recipe requires a particular ref.
#SRCREV = ""

# Move vmlinux-${KERNEL_VERSION_NAME} from /boot to /lib/modules/${KERNEL_VERSION}/build/
# to avoid filling the /boot partition.
FILES_${KERNEL_PACKAGE_NAME}-vmlinux_remove = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
FILES_${KERNEL_PACKAGE_NAME}-vmlinux += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build/vmlinux-${KERNEL_VERSION_NAME}"

do_install_append(){
    install -d "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
    mv ${D}/boot/vmlinux-${KERNEL_VERSION} "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build/"
}


DESCRIPTION = "Base package set for Jlime images."
SECTION = "x11/wm"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

PR = "r3"

inherit task

PROVIDES = "${PACKAGES}"
PACKAGES = "\
    ${PN}-cli \
    ${PN}-gui \
    "

RDEPENDS_${PN}-cli = " \
    file \
    htop \
    lsof \
    sudo \
    vim \
    "

RDEPENDS_${PN}-gui = " \
    claws-mail \
    epdfview \
    gcalctool \
    gnome-mplayer \
    leafpad \
    midori \
    pidgin \
    xarchiver \
    xchat \
    xnoise \
    "

Add some extra apps to Jlime images.

DESCRIPTION = "Base package set for Jlime images."
SECTION = "x11/wm"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

PR = "r4"

inherit task

PROVIDES = "${PACKAGES}"
PACKAGES = "\
    ${PN}-cli \
    ${PN}-gui \
    "

RDEPENDS_${PN}-cli = " \
    dropbear \
    file \
    htop \
    lsof \
    sudo \
    tmux \
    vim \
    "

RDEPENDS_${PN}-gui = " \
    abiword \
    batti \
    claws-mail \
    epdfview \
    gcalctool \
    gnome-mplayer \
    leafpad \
    liferea \
    midori \
    notification-daemon \
    pidgin \
    remmina \
    xarchiver \
    xchat \
    xnoise \
    "


require u-boot-ti.inc

PR = "r28"

BRANCH = "ti-u-boot-2020.01"

SRCREV = "71ba4a5f933a1f03e8bb72d487a62a877c2135ff"

Update to the latest commit

require u-boot-ti.inc

PR = "r29"

BRANCH = "ti-u-boot-2020.01"

SRCREV = "df5e46d817182dcbd52212a7ff3c31eb20398dbe"


SUMMARY = "Resin Package Groups"
LICENSE = "Apache-2.0"

PR = "r1"

inherit packagegroup

RESIN_INIT_PACKAGE ?= "resin-init"

RDEPENDS_${PN} = "\
	${@bb.utils.contains('DISTRO_FEATURES', 'resin-staging', 'nano', '', d)} \
	${RESIN_INIT_PACKAGE} \
	linux-firmware-ath9k \
	linux-firmware-ralink \
	linux-firmware-rtl8192cu \
	kernel-modules \
	wireless-tools \
	parted \
	lvm2 \
	openssl \
	dosfstools \
	e2fsprogs \
	connman \
	connman-client \
	btrfs-tools \
	apt \
	rce \
	tar \
	util-linux \
	socat \
	jq curl \
	resin-device-register \
	resin-device-progress \
	resin-device-update \
	resin-btrfs-balance \
	supervisor-init \
	vpn-init \
	bridge-utils \
	"

Add iozone to staging build

SUMMARY = "Resin Package Groups"
LICENSE = "Apache-2.0"

PR = "r1"

inherit packagegroup

RESIN_INIT_PACKAGE ?= "resin-init"
RESIN_STAGING_ADDONS = "iozone3 nano"

RDEPENDS_${PN} = "\
	${@bb.utils.contains('DISTRO_FEATURES', 'resin-staging', '${RESIN_STAGING_ADDONS}', '', d)} \
	${RESIN_INIT_PACKAGE} \
	linux-firmware-ath9k \
	linux-firmware-ralink \
	linux-firmware-rtl8192cu \
	kernel-modules \
	wireless-tools \
	parted \
	lvm2 \
	openssl \
	dosfstools \
	e2fsprogs \
	connman \
	connman-client \
	btrfs-tools \
	apt \
	rce \
	tar \
	util-linux \
	socat \
	jq curl \
	resin-device-register \
	resin-device-progress \
	resin-device-update \
	resin-btrfs-balance \
	supervisor-init \
	vpn-init \
	bridge-utils \
	"


SUMMARY = "Non-critical, but desirable packages. These packages are not \
permitted to fail during build."
LICENSE = "MIT"

inherit packagegroup

# essential packagegroups
RDEPENDS_${PN} += "\
	packagegroup-core-tools-debug \
	packagegroup-ni-debug-kernel \
	packagegroup-ni-ptest \
	packagegroup-ni-selinux \
"

RDEPENDS_${PN}_append_x64 = "\
	packagegroup-ni-next-kernel \
	packagegroup-ni-nohz-kernel \
	packagegroup-ni-mono-extra \
	florence \
	ni-grpc-device \
"

RDEPENDS_${PN} += "\
	binutils \
	cgdb \
	cifs-utils \
	elfutils \
	file \
	g++ \
	gcc \
	gdb \
	git \
	gperf \
	htop \
	iperf2 \
	iperf3 \
	kernel-performance-tests \
	ldd \
	ltrace \
	mysql-python \
	ntpdate \
	openssl-dev \
	perf \
	python-modules \
	python-nose \
	python-pip \
	python-psutil \
	python-setuptools \
	python3-dev \
	python3-misc \
	python3-pip \
	rsync \
	sshpass \
	strace \
	valgrind \
	vim \
"

Add ptest for NO_HZ_FULL configured kernels to desirable group

SUMMARY = "Non-critical, but desirable packages. These packages are not \
permitted to fail during build."
LICENSE = "MIT"

inherit packagegroup

# essential packagegroups
RDEPENDS_${PN} += "\
	packagegroup-core-tools-debug \
	packagegroup-ni-debug-kernel \
	packagegroup-ni-ptest \
	packagegroup-ni-selinux \
"

RDEPENDS_${PN}_append_x64 = "\
	packagegroup-ni-next-kernel \
	packagegroup-ni-nohz-kernel \
	packagegroup-ni-mono-extra \
	florence \
	ni-grpc-device \
"

RDEPENDS_${PN} += "\
	binutils \
	cgdb \
	cifs-utils \
	elfutils \
	file \
	g++ \
	gcc \
	gdb \
	git \
	gperf \
	htop \
	iperf2 \
	iperf3 \
	kernel-performance-tests \
	kernel-test-nohz \
	ldd \
	ltrace \
	mysql-python \
	ntpdate \
	openssl-dev \
	perf \
	python-modules \
	python-nose \
	python-pip \
	python-psutil \
	python-setuptools \
	python3-dev \
	python3-misc \
	python3-pip \
	rsync \
	sshpass \
	strace \
	valgrind \
	vim \
"


DESCRIPTION = "Diversity_radar - a GPS location based communicative application"
HOMEPAGE = "http://diversity.projects.openmoko.org/"
SECTION = "openmoko/applications"
LICENSE = "GPL"
DEPENDS = "python-evas python-edje python-ecore python-edbus python-dbus python-etk"
RDEPENDS_${PN} = "diversity-daemon"
PV = "0.0.4+svnr${SRCREV}"
PR = "r0.01"

SRC_URI = "svn://svn.projects.openmoko.org/svnroot/diversity/toys;module=diversity-radar;proto=http"

S = "${WORKDIR}/${PN}"

inherit setuptools

FILES_${PN} += "${prefix}/share/*"

PKG_TAGS_${PN} = "group::communication alias::Diversity_Radar"

Revert "[alias name] Adding alias name tags for packages"

DESCRIPTION = "Diversity_radar - a GPS location based communicative application"
HOMEPAGE = "http://diversity.projects.openmoko.org/"
SECTION = "openmoko/applications"
LICENSE = "GPL"
DEPENDS = "python-evas python-edje python-ecore python-edbus python-dbus python-etk"
RDEPENDS_${PN} = "diversity-daemon"
PV = "0.0.4+svnr${SRCREV}"
PR = "r0.01"

SRC_URI = "svn://svn.projects.openmoko.org/svnroot/diversity/toys;module=diversity-radar;proto=http"

S = "${WORKDIR}/${PN}"

inherit setuptools

FILES_${PN} += "${prefix}/share/*"

PKG_TAGS_${PN} = "group::communication"


DESCRIPTION = "Packages for Amazon Web Services."
LICENSE = "MIT"

inherit packagegroup

RDEPENDS_${PN} = "\
	aws-iot-device-sdk-embedded-c \
	aws-iot-device-sdk-embedded-c-dev \
	python-aws-iot-device-sdk \
	python-aws-iot-device-sdk-samples \
	aws-iot-device-sdk-java \
	python-awscli \
"

PR = "r0"

PACKAGES = "${PN}"

Add JavaScript package to AWS package group

DESCRIPTION = "Packages for Amazon Web Services."
LICENSE = "MIT"

inherit packagegroup

RDEPENDS_${PN} = "\
	aws-iot-device-sdk-embedded-c \
	aws-iot-device-sdk-embedded-c-dev \
	python-aws-iot-device-sdk \
	python-aws-iot-device-sdk-samples \
	aws-iot-device-sdk-java \
	node-aws-iot-device-sdk-js \
	python-awscli \
"

PR = "r0"

PACKAGES = "${PN}"


SUMMARY = "IoT Reference OS Kit image for Gateway profile."
DESCRIPTION = "IoT Reference OS Kit image for Gateway profile."

REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES ?= "${REFKIT_IMAGE_FEATURES_COMMON}"
REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL ?= "${REFKIT_IMAGE_INSTALL_COMMON}"
REFKIT_IMAGE_EXTRA_FEATURES += "${REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES}"
REFKIT_IMAGE_EXTRA_INSTALL += "${REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL}"

REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES_append = " iotivity nodejs-runtime"

# Example for customization in local.conf when building
# refkit-image-gateway.bb:
# IMAGE_BASENAME_pn-refkit-image-gateway = "my-refkit-image-gateway"
# REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL_append = "my-own-package"
# REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES_append = "dev-pkgs"

inherit refkit-image

Add bluetooth audio feature to gateway profile

SUMMARY = "IoT Reference OS Kit image for Gateway profile."
DESCRIPTION = "IoT Reference OS Kit image for Gateway profile."

REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES ?= "${REFKIT_IMAGE_FEATURES_COMMON}"
REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL ?= "${REFKIT_IMAGE_INSTALL_COMMON}"
REFKIT_IMAGE_EXTRA_FEATURES += "${REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES}"
REFKIT_IMAGE_EXTRA_INSTALL += "${REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL}"

REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES_append = " iotivity nodejs-runtime bluetooth-audio"

# Example for customization in local.conf when building
# refkit-image-gateway.bb:
# IMAGE_BASENAME_pn-refkit-image-gateway = "my-refkit-image-gateway"
# REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL_append = "my-own-package"
# REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES_append = "dev-pkgs"

inherit refkit-image


DESCRIPTION = "langtable is used to guess reasonable defaults for locale,\
keyboard, territory"
HOMEPAGE = "https://github.com/mike-fabian/langtable/"
LICENSE = "GPLv3+"
SECTION = "devel/python"

LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"

S = "${WORKDIR}/git"
B = "${S}"

SRCREV = "35687ca957b746f153a6872139462b1443f8cad1"
PV = "0.0.38+git${SRCPV}"
SRC_URI = "git://github.com/mike-fabian/langtable.git;branch=master \
"

inherit setuptools3 python3native

DISTUTILS_INSTALL_ARGS = "--prefix=${D}/${prefix} \
    --install-data=${D}/${datadir}/langtable"

FILES_${PN} += "${datadir}/*"

RDEPENDS_${PN} += " \
    ${PYTHON_PN}-argparse \
    ${PYTHON_PN}-compression \
    ${PYTHON_PN}-doctest \
    ${PYTHON_PN}-enum \
    ${PYTHON_PN}-logging \
    ${PYTHON_PN}-signal \
    ${PYTHON_PN}-xml \
"

Remove deprecated python3-signal from the RDEPENDS

DESCRIPTION = "langtable is used to guess reasonable defaults for locale,\
keyboard, territory"
HOMEPAGE = "https://github.com/mike-fabian/langtable/"
LICENSE = "GPLv3+"
SECTION = "devel/python"

LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"

S = "${WORKDIR}/git"
B = "${S}"

SRCREV = "35687ca957b746f153a6872139462b1443f8cad1"
PV = "0.0.38+git${SRCPV}"
SRC_URI = "git://github.com/mike-fabian/langtable.git;branch=master \
"

inherit setuptools3 python3native

DISTUTILS_INSTALL_ARGS = "--prefix=${D}/${prefix} \
    --install-data=${D}/${datadir}/langtable"

FILES_${PN} += "${datadir}/*"

RDEPENDS_${PN} += " \
    ${PYTHON_PN}-argparse \
    ${PYTHON_PN}-compression \
    ${PYTHON_PN}-doctest \
    ${PYTHON_PN}-enum \
    ${PYTHON_PN}-logging \
    ${PYTHON_PN}-xml \
"


SUMMARY = "The Sodium crypto library"
HOMEPAGE = "http://libsodium.org/"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c9f00492f01f5610253fde01c3d2e866"

SRC_URI = "https://download.libsodium.org/libsodium/releases/${BPN}-${PV}.tar.gz"
SRC_URI[md5sum] = "b58928d035064b2a46fb564937b83540"
SRC_URI[sha256sum] = "a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765"

inherit autotools

Extend recipe for native and nativesdk usage

SUMMARY = "The Sodium crypto library"
HOMEPAGE = "http://libsodium.org/"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c9f00492f01f5610253fde01c3d2e866"

SRC_URI = "https://download.libsodium.org/libsodium/releases/${BPN}-${PV}.tar.gz"
SRC_URI[md5sum] = "b58928d035064b2a46fb564937b83540"
SRC_URI[sha256sum] = "a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765"

inherit autotools

BBCLASSEXTEND = "native nativesdk"


DESCRIPTION = "Interface for GDB to commincate witha TI C66X DSP"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING.txt;md5=75859989545e37968a99b631ef42722e"

# This package builds a kernel module, use kernel PR as base and append a local
MACHINE_KERNEL_PR_append = "a"
PR = "${MACHINE_KERNEL_PR}"
PV_append = "+git${SRCPV}"

S = "${WORKDIR}/git/kernel_module/gdbproxy-mod"

inherit module

PLATFORM = ""
PLATFORM_dra7xx = "DRA7xx_PLATFORM"
PLATFORM_keystone = "KEYSTONE_PLATFORM"

EXTRA_OEMAKE = "PLATFORM=${PLATFORM}"

# The following is to prevent an unused configure.ac from erroneously
# triggering the QA check for gettext.
EXTRA_OECONF = "--disable-nls"
do_configure() {
    :
}

COMPATIBLE_MACHINE = "dra7xx|keystone"
PACKAGE_ARCH = "${MACHINE_ARCH}"

include gdbc6x.inc

module_autoload_gdbserverproxy = "gdbserverproxy"

Fix build issue with fido

DESCRIPTION = "Interface for GDB to commincate witha TI C66X DSP"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING.txt;md5=75859989545e37968a99b631ef42722e"

# This package builds a kernel module, use kernel PR as base and append a local
MACHINE_KERNEL_PR_append = "b"
PR = "${MACHINE_KERNEL_PR}"
PV_append = "+git${SRCPV}"

S = "${WORKDIR}/git/kernel_module/gdbproxy-mod"

inherit module

PLATFORM = ""
PLATFORM_dra7xx = "DRA7xx_PLATFORM"
PLATFORM_keystone = "KEYSTONE_PLATFORM"

EXTRA_OEMAKE = "PLATFORM=${PLATFORM} KVERSION=${KERNEL_VERSION} KERNEL_SRC=${STAGING_KERNEL_DIR}"

# The following is to prevent an unused configure.ac from erroneously
# triggering the QA check for gettext.
EXTRA_OECONF = "--disable-nls"
do_configure() {
    :
}

COMPATIBLE_MACHINE = "dra7xx|keystone"
PACKAGE_ARCH = "${MACHINE_ARCH}"

include gdbc6x.inc

KERNEL_MODULE_AUTOLOAD += "gdbserverproxy"


DESCRIPTION = "GRand Unified Bootloader"
HOMEPAGE = "http://www.gnu.org/software/grub"
SECTION = "bootloaders"
PRIORITY = "optional"
RDEPENDS = "diffutils"
PR = "r4"

SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://automake-1.10.patch;patch=1 \
           file://menu.lst"

inherit autotools

python __anonymous () {
    import re
    host = bb.data.getVar('HOST_SYS', d, 1)
    if not re.match('i.86.*-linux', host):
        raise bb.parse.SkipPackage("incompatible with host %s" % host)
}

do_install_append() {
        install -d ${D}/boot/
	ln -sf ../usr/lib/grub/i386${TARGET_VENDOR}/ ${D}/boot/grub

	# TODO: better use grub-set-default script here?
	install -m 0644  ${WORKDIR}/menu.lst ${D}/boot/grub
}

FILES_${PN}-doc = "${datadir}"
FILES_${PN} = "/boot /usr"

Split the grub-install script and friends into a separate package.

DESCRIPTION = "GRand Unified Bootloader"
HOMEPAGE = "http://www.gnu.org/software/grub"
SECTION = "bootloaders"
PRIORITY = "optional"
RDEPENDS_${PN}-install = "diffutils"
PR = "r5"

SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz \
           file://automake-1.10.patch;patch=1 \
           file://menu.lst"

inherit autotools

do_install_append() {
        install -m 0644 -D ${WORKDIR}/menu.lst ${D}/boot/grub/menu.lst

        # Copy stage1/1_5/2 files to /boot/grub
        GRUB_TARGET_ARCH=$(echo ${TARGET_ARCH} | sed -e 's/.86/386/')
        install -m 0644 \
                ${D}/${libdir}/grub/${GRUB_TARGET_ARCH}${TARGET_VENDOR}/* \
                ${D}/boot/grub/
}

PACKAGES =+ "${PN}-install ${PN}-eltorito"

FILES_${PN}-install = " \
        ${sbindir}/grub-install \
        ${sbindir}/grub-terminfo \
        ${sbindir}/grub-md5-crypt \
        ${bindir}/mbchk \
        ${libdir}/grub \
"
FILES_${PN}-eltorito = "/boot/grub/stage2_eltorito"
FILES_${PN} += "/boot"

COMPATIBLE_HOST = "i.86.*-linux"


#
#   Copyright (C) 2017 Pelagicore AB
#   SPDX-License-Identifier: MIT
#

DESCRIPTION = "Reference PELUX image with QtAuto frontend"

inherit core-image-pelux-qtauto

# This image uses neptune as the reference UI
IMAGE_INSTALL += " neptune-ui "

Add Qt tools to SDK for QtAuto neptune image

#
#   Copyright (C) 2017 Pelagicore AB
#   SPDX-License-Identifier: MIT
#

DESCRIPTION = "Reference PELUX image with QtAuto frontend"

inherit core-image-pelux-qtauto
inherit populate_sdk_qt5

# This image uses neptune as the reference UI
IMAGE_INSTALL += " neptune-ui "


require conf/distro/include/pareon.inc

DESCRIPTION = "Pareon Verify shared library"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://${PAREON_DIR}/EULA.exec;md5=1c43b59db6eab4e68de95551563c708b"

# Sabotage the default dependencies to avoid dependency loops trying to build lowlevel recipes with pareon
INHIBIT_DEFAULT_DEPS = "1"

SRC_URI += "file://pareon_run.sh.template"

do_compile() {
    awk -v PAREON_LIBDIR=${PAREON_LIBDIR} '{gsub(/@@PAREON_LIBDIR@@/, PAREON_LIBDIR); print}' < ${WORKDIR}/pareon_run.sh.template > ${WORKDIR}/pareon_run.sh
}

do_install() {
    # copy wrapper script
    install -d ${D}${bindir}
    install -m 0755 ${WORKDIR}/pareon_run.sh ${D}${bindir}

    # copy libpareon_verify and libstdc++
    install -d ${D}${PAREON_LIBDIR}
    cp -a ${PAREON_LIBDIR}/* ${D}${PAREON_LIBDIR}
    cp -a ${PAREON_CXXDIR}/* ${D}${PAREON_LIBDIR}
}

Fix FILES variable in libpareon-verify_vs.bb

require conf/distro/include/pareon.inc

DESCRIPTION = "Pareon Verify shared library"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://${PAREON_DIR}/EULA.exec;md5=1c43b59db6eab4e68de95551563c708b"

# Sabotage the default dependencies to avoid dependency loops trying to build lowlevel recipes with pareon
INHIBIT_DEFAULT_DEPS = "1"

SRC_URI += "file://pareon_run.sh.template"

FILES_${PN} += "${PAREON_LIBDIR}/libpareon_verify.so.* ${PAREON_LIBDIR}/libstdc++.so.*"
FILES_${PN}-dbg += "${PAREON_LIBDIR}.debug"

do_compile() {
    awk -v PAREON_LIBDIR=${PAREON_LIBDIR} '{gsub(/@@PAREON_LIBDIR@@/, PAREON_LIBDIR); print}' < ${WORKDIR}/pareon_run.sh.template > ${WORKDIR}/pareon_run.sh
}

do_install() {
    # copy wrapper script
    install -d ${D}${bindir}
    install -m 0755 ${WORKDIR}/pareon_run.sh ${D}${bindir}

    # copy libpareon_verify and libstdc++
    install -d ${D}${PAREON_LIBDIR}
    cp -a ${PAREON_LIBDIR}/libpareon_verify.so.* ${D}${PAREON_LIBDIR}
    cp -a ${PAREON_CXXDIR}/libstdc++.so.* ${D}${PAREON_LIBDIR}
}


DESCRIPTION = "GStreamer elements to use the multimedia accelerators available on some TI parts"
LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"

require gstreamer1.0-plugins-ti.inc

PR = "${INC_PR}.28"
SRCREV = "7f3326b81b838fb6c916acd1d6a3090fda12c772"

BRANCH ?= "master"

SRC_URI = "git://git.ti.com/glsdk/gst-plugin-ducati.git;protocol=git;branch=${BRANCH} \
          "

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

Update SRCREV with latest commit

DESCRIPTION = "GStreamer elements to use the multimedia accelerators available on some TI parts"
LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"

require gstreamer1.0-plugins-ti.inc

PR = "${INC_PR}.29"
SRCREV = "19e911bb45757d8341ffd7819ca783ca04f5e3b1"

BRANCH ?= "master"

SRC_URI = "git://git.ti.com/glsdk/gst-plugin-ducati.git;protocol=git;branch=${BRANCH} \
          "

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"


DESCRIPTION = "Configuration files for online package repositories of the Openmoko community repository feeds."
PR = "r0.04"

do_compile() {
    mkdir -p ${S}/${sysconfdir}/opkg
    for feed in Multiverse; do
        echo "src/gz daily-${feed} ${OPENMOKO_URI}/${feed}" > ${S}/${sysconfdir}/opkg/${feed}-feed.conf
    done
}
do_install () {
        install -d ${D}${sysconfdir}/opkg
        install -m 0644  ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
}

PACKAGE_ARCH = "${MACHINE_ARCH}"

CONFFILES_${PN} += "${sysconfdir}/opkg/Multiverse-feed.conf"

PKG_TAGS_${PN} = "group::repos alias::Om_Multiverse"

OPENMOKO_URI = "http://downloads.openmoko.org/repository"

Revert "[Descriptions] Adding more description to applications"

DESCRIPTION = "Configuration files for online package repositories of Openmoko community repository feeds"
PR = "r0.03"

do_compile() {
    mkdir -p ${S}/${sysconfdir}/opkg
    for feed in Multiverse; do
        echo "src/gz daily-${feed} ${OPENMOKO_URI}/${feed}" > ${S}/${sysconfdir}/opkg/${feed}-feed.conf
    done
}
do_install () {
        install -d ${D}${sysconfdir}/opkg
        install -m 0644  ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
}

PACKAGE_ARCH = "${MACHINE_ARCH}"

CONFFILES_${PN} += "${sysconfdir}/opkg/Multiverse-feed.conf"

PKG_TAGS_${PN} = "group::repos alias::Om_Multiverse"

OPENMOKO_URI = "http://downloads.openmoko.org/repository"


SUMMARY = "Xilinx HDMI Linux Kernel module"
DESCRIPTION = "Out-of-tree HDMI kernel modules provider for MPSoC EG/EV devices"
SECTION = "kernel/modules"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=570506b747d768e7802376f932dff926"

XLNX_HDMI_VERSION = "5.4.0"
PV = "${XLNX_HDMI_VERSION}"

S = "${WORKDIR}/git"

BRANCH ?= "rel-v2020.2"
REPO   ?= "git://github.com/xilinx/hdmi-modules.git;protocol=https"
SRCREV ?= "2cbacc12910bab236e491c5aa44999fa16cbaea9"

BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}"
SRC_URI = "${REPO};${BRANCHARG}"

inherit module

EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}"
COMPATIBLE_MACHINE = "^$"
COMPATIBLE_MACHINE_zynqmp = "zynqmp"
COMPATIBLE_MACHINE_versal = "versal"

Update commit id and branch for 2021 release

SUMMARY = "Xilinx HDMI Linux Kernel module"
DESCRIPTION = "Out-of-tree HDMI kernel modules provider for MPSoC EG/EV devices"
SECTION = "kernel/modules"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=570506b747d768e7802376f932dff926"

XLNX_HDMI_VERSION = "5.4.0"
PV = "${XLNX_HDMI_VERSION}"

S = "${WORKDIR}/git"

BRANCH ?= "master"
REPO   ?= "git://github.com/Xilinx/hdmi-modules.git;protocol=https"
SRCREV = "007af0d54fdccd7fdd93095511b5a5a886aea30b"

BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}"
SRC_URI = "${REPO};${BRANCHARG}"

inherit module

EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}"
COMPATIBLE_MACHINE = "^$"
COMPATIBLE_MACHINE_zynqmp = "zynqmp"
COMPATIBLE_MACHINE_versal = "versal"