Skip to content

Commit

Permalink
Change the package of Kotlin cluster lib to package matter.controller…
Browse files Browse the repository at this point in the history
….cluster.clusters (project-chip#30945)
  • Loading branch information
yufengwangca authored and thivya-amazon committed Dec 12, 2023
1 parent 0c18eaf commit 6bdc2da
Show file tree
Hide file tree
Showing 313 changed files with 2,075 additions and 1,182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java.util.logging.Level
import java.util.logging.Logger
import kotlinx.coroutines.runBlocking
import matter.controller.MatterController
import matter.devicecontroller.cluster.clusters.IdentifyCluster
import matter.controller.cluster.clusters.IdentifyCluster

class PairOnNetworkLongImInvokeCommand(
controller: MatterController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.util.logging.Level
import java.util.logging.Logger
import kotlinx.coroutines.runBlocking
import matter.controller.MatterController
import matter.devicecontroller.cluster.clusters.BasicInformationCluster
import matter.controller.cluster.clusters.BasicInformationCluster

class PairOnNetworkLongImReadCommand(controller: MatterController, credsIssue: CredentialsIssuer?) :
PairingCommand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java.util.logging.Level
import java.util.logging.Logger
import kotlinx.coroutines.runBlocking
import matter.controller.MatterController
import matter.devicecontroller.cluster.clusters.BasicInformationCluster
import matter.controller.cluster.clusters.BasicInformationCluster

class PairOnNetworkLongImWriteCommand(
controller: MatterController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,27 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.util.logging.Level
import java.util.logging.Logger
import java.time.Duration
import matter.controller.*
import matter.controller.MatterController
import matter.controller.ReadRequest
import matter.controller.ReadData
import matter.controller.ReadFailure
import matter.controller.ReadResponse
import matter.controller.SubscribeRequest
import matter.controller.SubscriptionState
import matter.controller.WriteRequest
import matter.controller.WriteRequests
import matter.controller.WriteResponse
import matter.controller.AttributeWriteError
import matter.controller.InvokeRequest
import matter.controller.InvokeResponse
import matter.controller.model.AttributePath
import matter.controller.model.CommandPath
import matter.devicecontroller.cluster.structs.*
import matter.controller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
List<{{encode_value(source, encodable.without_list(), depth + 1)}}>
{%- elif encodable.is_struct -%}
{%- set struct = encodable.get_underlying_struct() -%}
matter.devicecontroller.cluster.structs.{{source.name}}Cluster{{struct.name}}
matter.controller.cluster.structs.{{source.name}}Cluster{{struct.name}}
{%- else -%}
{{encodable.kotlin_type}}
{%- endif -%}
Expand Down Expand Up @@ -63,7 +63,7 @@
}
{%- elif encodable.is_struct -%}
{%- set struct = encodable.get_underlying_struct() -%}
matter.devicecontroller.cluster.structs.{{source.name}}Cluster{{struct.name}}.fromTlv({{tag}}, tlvReader)
matter.controller.cluster.structs.{{source.name}}Cluster{{struct.name}}.fromTlv({{tag}}, tlvReader)
{%- else -%}
tlvReader.get{{encodable.kotlin_type}}({{tag}})
{%- endif -%}
Expand All @@ -89,10 +89,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package matter.devicecontroller.cluster.eventstructs
package matter.controller.cluster.eventstructs

import java.util.Optional
import matter.devicecontroller.cluster.*
import matter.controller.cluster.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ matter_structs_sources = [
{%- set typeLookup = idl | createLookupContext(cluster) %}
{%- for struct in cluster.structs | sort(attribute='name') %}
{%- if not struct.tag %}
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/{{cluster.name}}Cluster{{struct.name}}.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/{{cluster.name}}Cluster{{struct.name}}.kt",
{%- endif %}
{%- endfor %}
{%- endfor %}
Expand All @@ -17,7 +17,7 @@ matter_eventstructs_sources = [
{%- set typeLookup = idl | createLookupContext(cluster) %}
{%- for event in cluster.events | sort(attribute='name') %}
{%- if event.fields %}
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/{{cluster.name}}Cluster{{event.name}}Event.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/{{cluster.name}}Cluster{{event.name}}Event.kt",
{%- endif %}
{%- endfor %}
{%- endfor %}
Expand All @@ -26,6 +26,6 @@ matter_eventstructs_sources = [
matter_clusters_sources = [
{%- for cluster in clientClusters | sort(attribute='name') %}
{%- set typeLookup = idl | createLookupContext(cluster) %}
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/{{cluster.name}}Cluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/{{cluster.name}}Cluster.kt",
{%- endfor %}
]
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package matter.devicecontroller.cluster.structs
package matter.controller.cluster.structs

import java.util.Optional
import matter.devicecontroller.cluster.*
import matter.controller.cluster.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.Tag
Expand Down
10 changes: 5 additions & 5 deletions scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def boxed_java_signature(self):
else:
return "Ljava/lang/Integer;"
else:
return "Lchip/devicecontroller/ChipStructs${}Cluster{};".format(self.context.cluster.name, self.data_type.name)
return "Lchip/controller/ChipStructs${}Cluster{};".format(self.context.cluster.name, self.data_type.name)


def GlobalEncodableValueFrom(typeName: str, context: TypeLookupContext) -> EncodableValue:
Expand Down Expand Up @@ -669,7 +669,7 @@ def internal_render_all(self):

self.internal_render_one_output(
template_path="MatterFiles_gni.jinja",
output_file_name="java/matter/devicecontroller/cluster/files.gni",
output_file_name="java/matter/controller/cluster/files.gni",
vars={
'idl': self.idl,
'clientClusters': clientClusters,
Expand All @@ -678,7 +678,7 @@ def internal_render_all(self):

# Generate a `.kt` file for each cluster.
for cluster in clientClusters:
output_name = f"java/matter/devicecontroller/cluster/clusters/{cluster.name}Cluster.kt"
output_name = f"java/matter/controller/cluster/clusters/{cluster.name}Cluster.kt"
self.internal_render_one_output(
template_path="MatterClusters.jinja",
output_file_name=output_name,
Expand All @@ -695,7 +695,7 @@ def internal_render_all(self):
if struct.tag:
continue

output_name = "java/matter/devicecontroller/cluster/structs/{cluster_name}Cluster{struct_name}.kt"
output_name = "java/matter/controller/cluster/structs/{cluster_name}Cluster{struct_name}.kt"
self.internal_render_one_output(
template_path="MatterStructs.jinja",
output_file_name=output_name.format(
Expand All @@ -712,7 +712,7 @@ def internal_render_all(self):
if not event.fields:
continue

output_name = "java/matter/devicecontroller/cluster/eventstructs/{cluster_name}Cluster{event_name}Event.kt"
output_name = "java/matter/controller/cluster/eventstructs/{cluster_name}Cluster{event_name}Event.kt"
self.internal_render_one_output(
template_path="MatterEventStructs.jinja",
output_file_name=output_name.format(
Expand Down
2 changes: 1 addition & 1 deletion src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ kotlin_library("chipcluster_test") {

kotlin_library("kotlin_matter_controller") {
import(
"${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni")
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/files.gni")

output_name = "KotlinMatterController.jar"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.time.Duration
import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.WriteRequest
import matter.controller.WriteRequests
import matter.controller.WriteResponse
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.time.Duration
import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.InvokeRequest
import matter.controller.InvokeResponse
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.controller.model.CommandPath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.TlvReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.time.Duration
import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.InvokeRequest
import matter.controller.InvokeResponse
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.controller.model.CommandPath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.TlvReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.time.Duration
import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.InvokeRequest
import matter.controller.InvokeResponse
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.WriteRequest
import matter.controller.WriteRequests
import matter.controller.WriteResponse
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.controller.model.CommandPath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.time.Duration
import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.InvokeRequest
import matter.controller.InvokeResponse
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.controller.model.CommandPath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.TlvReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.TlvReader

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.TlvReader

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.time.Duration
import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.InvokeRequest
import matter.controller.InvokeResponse
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.controller.model.CommandPath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.TlvReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
* limitations under the License.
*/

package matter.devicecontroller.cluster.clusters
package matter.controller.cluster.clusters

import java.time.Duration
import java.util.logging.Level
import java.util.logging.Logger
import matter.controller.*
import matter.controller.InvokeRequest
import matter.controller.InvokeResponse
import matter.controller.MatterController
import matter.controller.ReadData
import matter.controller.ReadRequest
import matter.controller.cluster.structs.*
import matter.controller.model.AttributePath
import matter.controller.model.CommandPath
import matter.devicecontroller.cluster.structs.*
import matter.tlv.AnonymousTag
import matter.tlv.ContextSpecificTag
import matter.tlv.TlvReader
Expand Down
Loading

0 comments on commit 6bdc2da

Please sign in to comment.