@@ -34,6 +34,7 @@ import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.Paths
34
34
import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.TargetProperties.Keys.BUILD_DEPS
35
35
import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.TargetProperties.Keys.DEPS_PREFIX
36
36
import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.TargetProperties.Keys.EDITION
37
+ import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.TargetProperties.Keys.ENABLED_FEATURES
37
38
import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.TargetProperties.Keys.ENTRY_POINT_PATH
38
39
import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.TargetProperties.Keys.FEATURES
39
40
import com.typedb.dependencies.tool.ide.RustManifestSyncer.WorkspaceSyncer.TargetProperties.Keys.LOCAL_PATH
@@ -263,7 +264,9 @@ class RustManifestSyncer : Callable<Unit> {
263
264
264
265
cargoToml.createSubConfig().apply {
265
266
cargoToml.set<Config >(" features" , this )
266
- properties.features.forEach { set<Config >(it, emptyList<String >()) }
267
+ (properties.enabledFeatures + properties.features)
268
+ .distinct()
269
+ .forEach { set<Config >(it, emptyList<String >()) }
267
270
}
268
271
269
272
cargoToml.createEntryPointSubConfig()
@@ -404,6 +407,7 @@ class RustManifestSyncer : Callable<Unit> {
404
407
val targetName : String ,
405
408
val cratePath : String ,
406
409
val type : Type ,
410
+ val enabledFeatures : Collection <String >,
407
411
val features : Collection <String >,
408
412
val version : String ,
409
413
val edition : String? ,
@@ -483,7 +487,7 @@ class RustManifestSyncer : Callable<Unit> {
483
487
val name = rawKey.split(" ." , limit = 2 )[1 ]
484
488
val rawValueProps = rawValue.split(" ;" )
485
489
.associate { it.split(" =" , limit = 2 ).let { parts -> parts[0 ] to parts[1 ] } }
486
- val features = rawValueProps[FEATURES ]?.split(" ," )?.filter { it != " bazel" } ? : emptyList();
490
+ val features = rawValueProps[ENABLED_FEATURES ]?.split(" ," )?.filter { it != " bazel" } ? : emptyList();
487
491
return if (VERSION in rawValueProps) {
488
492
Crate (
489
493
name = name,
@@ -542,6 +546,7 @@ class RustManifestSyncer : Callable<Unit> {
542
546
name = props.getProperty(NAME ),
543
547
targetName = props.getProperty(TARGET_NAME ),
544
548
type = Type .of(props.getProperty(TYPE )),
549
+ enabledFeatures = props.getProperty(ENABLED_FEATURES ).split(" ," ).filter { it.isNotBlank() },
545
550
features = props.getProperty(FEATURES ).split(" ," ).filter { it.isNotBlank() },
546
551
version = props.getProperty(VERSION ),
547
552
edition = props.getProperty(EDITION , " 2021" ),
@@ -567,6 +572,7 @@ class RustManifestSyncer : Callable<Unit> {
567
572
name = base.name,
568
573
targetName = base.targetName,
569
574
type = base.type,
575
+ enabledFeatures = (base.enabledFeatures + properties.enabledFeatures).distinct(),
570
576
features = (base.features + properties.features).distinct(),
571
577
version = base.version,
572
578
edition = base.edition,
@@ -595,6 +601,7 @@ class RustManifestSyncer : Callable<Unit> {
595
601
name = first.cratePath.replace(' /' , ' -' ),
596
602
targetName = first.targetName,
597
603
type = first.type,
604
+ enabledFeatures = first.enabledFeatures,
598
605
features = first.features,
599
606
version = first.version,
600
607
edition = first.edition,
@@ -617,6 +624,7 @@ class RustManifestSyncer : Callable<Unit> {
617
624
name = lib.name,
618
625
targetName = lib.targetName,
619
626
type = lib.type,
627
+ enabledFeatures = lib.enabledFeatures,
620
628
features = lib.features,
621
629
version = lib.version,
622
630
edition = lib.edition,
@@ -649,6 +657,7 @@ class RustManifestSyncer : Callable<Unit> {
649
657
const val DEPS_PREFIX = " deps"
650
658
const val EDITION = " edition"
651
659
const val ENTRY_POINT_PATH = " entry.point.path"
660
+ const val ENABLED_FEATURES = " enabled.features"
652
661
const val FEATURES = " features"
653
662
const val TARGET_NAME = " target.name"
654
663
const val NAME = " name"
0 commit comments